【发布时间】:2014-12-17 23:45:15
【问题描述】:
我在将 Opencart 中的 seo 友好 URL 从旧 http 应用到新 https 时遇到问题。
之前我们曾经有像 domain.com/productname 这样好的 seo url,但上个月我们为我们的网站购买了 ssl 证书,现在所有 url 都在其 https 版本上,所以这些产品页面已经改变了它的格式,例如从 @ 987654321@ 如果你点击链接,它现在就像 opencart 中的https://www.domain.com/index.php?route=productname 一样混乱。
我只是想消除这个 index.php?route= url 参数,以便所有链接都变成 domain.com/productname。我也尝试过 GWT 来获取它而不是重定向 URL。我还检查了标题状态是否为 200。
规范网址仍然在 http 而不是 https,并且一些产品链接仍然指向 http 而不是 https强>。
到目前为止,我对关于我们的页面没有任何问题,请联系我们,他们工作正常。
下面是我的 .htaccess:
RewriteEngine On
RewriteBase /
#RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
#RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^download/(.*) /index.php?route=error/not_found [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]
#This setting force logo url to it's home page
RewriteCond %{QUERY_STRING} ^route=common/home$
RewriteRule ^index\.php$ https://www.domain.com/? [R=301,L]
#This setting force http to https version
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.domain.com/$1 [R=301,L]
【问题讨论】:
标签: apache .htaccess mod-rewrite redirect seo