0
我有我.htaccess文件愉快地重写像/conferences/details/21
到/index.php?pages=conferences&var1=details&var2=21
的东西。重写旧的URL到新的,干净的
我Piwik跟踪这个网站,这正显示出了很多推荐的来自网站,也没有对URL如
http://www.domain.com/index.cfm?page=conference&intConferenceID=81
和更新自己的网址(这是一个非常新的网站重新做)
http://www.domain.com/index.cfm?page=conference&intConferenceID=88&type=conference
我想他们重写/conferences/details/[numeric ID seen above]
。
我已经试过这样:
RewriteRule ^index.cfm?page=conference&intConferenceID=(\d+)/?$ /conferences/details/$1 [L,NC,QSA]
Obvisouly忽略了第二个例子。但是,它给了我一个404说index.cfm
无法找到。
我需要写什么重写规则来重写上述格式化的链接(ID变更)为/conferences/details/[ID]
?
非常感谢。 'details'来自干净的URL,就像这样:'/ meetings/details/21'。我相应地编辑了我的问题。 – Bojangles
基本上,RewriteRule不会重写查询字符串,只是路径。您需要使用RewriteCond来匹配查询字符串,并使用% –