1
我有一个网站,有些网页在网址末尾有一个问号。这看起来像:
zip-da.ru/catalog/bumps.html?
如何从url中删除空的查询字符串?
,我希望它改写为:
zip-da.ru/catalog/bumps.html
我如何可以使用.htaccess文件做什么呢?
感谢您的帮助!到底
RewriteEngine On
RewriteCond %{THE_REQUEST} \?\s
RewriteRule^%{REQUEST_URI}? [L,R=302]
?
将从您的网址中去除查询字符串:
它不起作用:(它将http://zip-da.ru/catalogue?重定向到zip-da.ru/index.php –
它确实有效。'/catalog/bumps.html?'gets通过删除'?'重定向到'/ catalog/bumps.html' – anubhava
@GregoryZhdanov分享你的htaccess它可以有一些另外的规则 –