防止htaccess将¤更改为符号

时间:2018-08-14 15:08:44

标签: apache .htaccess redirect

由于某些原因,htaccess重定向使用诸如以下参数的参数保持更改的网址:

http://www.domain.om/product-name.html?language=en&currency=EURhttp://www.domain.om/product-name.html?language=en¤cy=EUR

而且我似乎无法阻止它。

RewriteCond %{REQUEST_URI} (c|m|p|pm)-([0-9_]+)(.html|html)
RewriteRule ^(.*)$ custom.php?type=html&q=$1&%{QUERY_STRING} [NE,L]

我更改了重写器标志,但似乎无济于事。我希望somsone可以指引我正确的方向或提供答案。

1 个答案:

答案 0 :(得分:0)

您应该使用QSA标志,该标志保留查询字符串:

RewriteCond %{REQUEST_URI} (c|m|p|pm)-([0-9_]+)(.html|html)
RewriteRule ^(.*)$ custom.php?type=html&q=$1 [NE,L,QSA]

您看到的内容很可能是由htaccess文件中的NE标志和其他规则引起的。