我们正在运行一个Magento网站,并且存在将www重定向到非www的问题。这是我的.htaccess文件的一部分:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
如果我写:www.xyz.com,那么它成功重定向到xyz.com
但如果我写: www.xyz.com/contact-us ,它会重定向到 www.xyz.com/index.php
这里有什么问题?我想行RewriteRule ^index\.php$ - [L]
没有被执行。