问题就像
http://www.example.com
时:它工作正常。https://www.example.com
时:我的www ssl证书可以正常使用http://example.com
时:我丢失了我的风格和图标。https://example.com
时:我丢失了我的风格和图标。现在我想以这些方式:
http://example.com
时:它应该重定向到https://www.example.com
http://www.example.com
时:它应该重定向到https://www.example.com
。example.com
时:它应该重定向到https://www.example.com
这是我当前的.htaccess.txt
# 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]
RewriteRule ^system/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]
请指导我如何实现我想要的以及如何解决样式和图标问题。在此先感谢!
答案 0 :(得分:2)
检查htaccess
:
RewriteCond %{HTTPS} off
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]