如何做一个普通的前pression为标签镆铘.htaccess文件?镆铘、一个普通、如何做、标签

2023-09-02 10:05:00 作者:宁愿把你宠坏

我需要一个正规的前pression明年网址:

I need a regular expression for next url:

sitio.com/blog/tag.html?tag=tecnology 转换成: sitio.com/blog/tag/tecnology

sitio.com/blog/tag.html?tag=tecnology convert to: sitio.com/blog/tag/tecnology

请注意:我激活了友好的URL为镆铘

note: I activated the friendly urls for modx.

推荐答案

下面是一个更好的方式来做到这一点使用镆铘内置功能。

Here's a better way to do this using MODX inbuilt functionality.

创建一个插件,触发对OnPageNotFound并解析了未找到URL(sitio.com/blog/tag/tecnology)到你希望的格式(sitio.com/blog/tag.html?tag=tecnology )。如果解析格式的现有镆铘的资源相匹配,你就可以重定向到它。

Create a plugin that fires on OnPageNotFound and parses the 'not found' url (sitio.com/blog/tag/tecnology) into the format you're expecting (sitio.com/blog/tag.html?tag=tecnology). If the parsed format matches an existing MODX resource you can then redirect to it.

http://forums.modx.com/index。 PHP /话题,41502.msg249684.html#msg249684