私は.NET開発者ですが、友人からサポートを求められました。.htaccessでいくつか変更を加えましたが、SEOが破損しています。
すべてがURLの「www」タグで始まりました。「www」を使用していないときにエラーが発生し、.htaccessが変更されました。書き換えルールが追加され、mysite.comがwww.mysite.comにリダイレクトされました。私たちの問題は解決されましたが、今は別の問題があります。
私たちはOpencart-SEOを使用しており、それが有効になっています。
http://www.mysite.com/epson-claria-uyumlu-yazici-kartus-dolum-murekkebi-500g.html
wwwで到達しているとき。
しかし、URLの「www」タグを削除すると、次のようになります。
http://www.mysite.com/index.php?_route_=epson-claria-uyumlu-yazici-kartus-dolum-murekkebi-500g.html
そしてそれはSEOを破壊します。
最初のURLと同じように2番目のURLを見たいです。
seo_url.php、.htaccessで遊んでみましたが、何も変わりません。
OpenCartからindex.php?route = common / homeを削除するソリューションも試しましたが、うまくいきませんでした。
これで、seo_url.phpがデフォルトになり、変更を取り戻すことができます。.htaccessは
# SEO URL Settings
RewriteEngine On
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/
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]
RewriteRule ^(.*)$ index.php?_route_=$1 [L]
私が夢中になる前に私を助けてください。私はそのために3時間を費やしています。
みなさん、ありがとうございました。