我想从我的网站域名的所有网址中删除www。我用下面的代码如何使用htaccess从我的网站域名的所有网址中删除www
RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]
但这个代码仅重定向到http://www.example.com
http://example.com
我想http://www.example.com/abcd
作为http://example.com/abcd
也
请帮助我。你的帮助将不胜感激。提前致谢。
感谢您的答复,但我的问题没有解决..我想'http://www.example.com/abcd为http:// example.com/abcd' – Vinie
这就是这个答案是做什么。确保此规则是您在root .htaccess中的第一条规则,并在新浏览器中进行测试。 – anubhava
谢谢它的作品:) – Vinie