[英].htaccess redirect all pages to the same page with parameter
我想将我网站的所有页面重定向到同一页面,但附加了get参数。
到目前为止我得到了什么:
#Check if Page already has parameter
RewriteCond !%{QUERY_STRING} (^|&)w=[0-9]+(&|$)
RewriteRule ^(.*)$ ......
我不知道如何使用附加的参数再次重定向到同一页面。
您没有使用正确的RewriteCond。 如果要将/filename.php重定向到/filename.php?q=filename ,可以使用它
RewriteEngine on
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^filename.php$ /filename.php?q=foobar [R,L]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.