我正在尝试重定向URL列表,但其中任何一个都有??它不起作用。例如,这是我的代码行...
Redirect 301 /calendar-of-events/day/date/2013-03-28/227.html?print=1&tmpl=component https://example.com/index.php/calendar/
这不会重定向。但是,如果我使用这个...
Redirect 301 /calendar-of-events/day/date/2013-03-28/227.html https://example.com/index.php/calendar/
...或这个...
Redirect 301 /calendar-of-events/day/date/2013-03-28/227.html&tmpl=component https://example.com/index.php/calendar/
...并测试网址,它们会正确重定向。
关于如何使它工作的任何想法?
您无法使用Redirect
指令匹配查询字符串。mod_rewrite
改为使用:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^print=1&tmpl=component$ [NC]
RewriteRule ^calendar-of-events/day/date/2013-03-28/227\.html$ https://example.com/index.php/calendar/? [L,R=301]
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句