如何做一个普通的前pression为标签镆铘.htaccess文件? [英] how to do a regular expression for the .htaccess file for tags in modx?
问题描述
我需要一个正规的前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
这篇关于如何做一个普通的前pression为标签镆铘.htaccess文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!