1

此 .htaccess 规则适用于以“format=pdf”查询字符串结尾的 url,但如果它位于 url 的中间则无效。

RewriteCond %{QUERY_STRING}  ^format=pdf$
RewriteRule (.*)  http://www.betonbetone.co.il/404?  [R=301,L]

作品:http://www.mysite.com/index.php/floor/230-1?format=pdf

不起作用:http://www.mysite.com/index.php?view=article&catid=37%3A2009-10-15-19-28-33&id=81%3A2009-09-21-21-00-34&format=pdf&option=com_content&Itemid=89

有人可以帮助使其适用于第二个网址吗?谢谢

4

1 回答 1

2

一些正则表达式操作:

RewriteCond %{QUERY_STRING} (^|&)format=pdf(&|$) [NC]
RewriteRule $ http://www.betonbetone.co.il/404?  [R=301,L]
于 2013-10-20T08:24:28.173 回答