Php 如何在Opencart日志主题中将所有非www重定向到www和SSL Url?
问题是Php 如何在Opencart日志主题中将所有非www重定向到www和SSL Url?,php,.htaccess,opencart,Php,.htaccess,Opencart,问题是 当我使用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
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]
请指导我如何实现我想要的,以及如何解决样式和图标问题。提前谢谢 检查内部的以下代码
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]
检查
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]
如果可以的话,最好在
httpd vhosts.conf
级别执行此操作。为有www和无www的域配置单独的
指令,其中“base”
具有类似重定向*https://www.example.com
在其中。如果可以,最好在httpd vhosts.conf
级别进行复制。为有www和无www的域配置单独的
指令,其中“base”
具有类似重定向*https://www.example.com
在其中。可能与