编辑:我必须添加的东西。首先,我想改变URL显示,因为SEO。如果我使用WWW到达我的网站没有问题,第二个链接出现,一切都OK。RewriteCond查询字符串.htaccess
但是,如果我从链接中删除“www”,它会更改为第一个网址,我不希望这样。
我想改变
到
http://www.mysite.com/epson-claria-uyumlu-yazici-kartus-dolum-murekkebi-500g.html
我该怎么办呢?
我试图
RewriteCond %{QUERY_STRING} ^_route_=(.*)$
RewriteRule ^index\.php$ /%1 [R=301,L]
,但它无法正常工作。
我的.htaccess是
RewriteBase/
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
RewriteCond %{QUERY_STRING} ^route=common/home$
RewriteRule ^index\.php$ http://www.mysite.com? [R=301,L]
RewriteCond %{HTTP_HOST} !^www\.mysite\.com$
RewriteRule (.*) http://www.mysite.com/$1 [R=301,L]
谢谢,你打我去修复这个错字;) – BenM
当我添加内部服务器时发生错误。 :/ – codeGenius
@BenM:任何时间...大声笑 – cHao