如果我有這樣的規則.htaccess:
RewriteCond %{QUERY_STRING} ^URL\=(. ?)(-[0-9] )?$
RewriteRule ^(.*)$ /index.php? [R=404,L]
我將如何更改它以便忽略?URL=站點自己的域之后的任何內容?
例如,my-domain.com?URL=http://porn.site被重定向,但my-domain.com?URL=https://my-domain.com/some-page被忽略。
uj5u.com熱心網友回復:
您可以使用:
RewriteCond %{QUERY_STRING} !^URL\=https?://my-domain.com [NC]
RewriteCond %{QUERY_STRING} ^URL\=(. ?)(-[0-9] )?$
RewriteRule ^(.*)$ /index.php? [R=404,L]
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/431731.html
上一篇:如何防止.htaccess規則在URL末尾添加無休止的重復引數
下一篇:RewriteBase值在哪里?
