2017-08-02 25 views
0

因此,我正在幫助一個人將所有HTTP請求重定向到HTTPS,但是在.htaccess中添加任何這些請求時仍然會出現循環錯誤。強制將HTTP重定向到HTTPS(Opencart v1.5.6.4)

ReWriteCond %{SERVER_PORT} 80 
Or 
RewriteCond %{HTTP:X-Forwarded-Proto} !https 
Or 
RewriteCond %{HTTPS} off 
Or 
RewriteCond %{HTTPS} !on 
Or 
RewriteCond %{HTTP:X-Forwarded-SSL} =off 

這是一個共享主機(如果那甚至很重要)。這是的phpinfo文件,也不太清楚怎麼我可以喜歡什麼this guy suggested

_SERVER["https_proxy"] 

http://www.supawhip.com.au/phpinfo.php

回答

1

通過的.htaccess使用在.htaccess試試這個:

<IfModule mod_rewrite.c> 
RewriteEngine On 
# This will enable the Rewrite capabilities 

RewriteCond %{HTTPS} !=on 
# This checks to make sure the connection is not already HTTPS 

RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R=301,L] 
# This rule will redirect users from their original location, to the same location but using HTTPS. 
# i.e. http://www.example.com/foo/ to https://www.example.com/foo/ 
# The leading slash is made optional so that this will work either in httpd.conf 
# or .htaccess context 
</IfModule> 

/config.php

// HTTP 
define('HTTP_SERVER', 'https://www.supawhip.com.au/'); 
// HTTPS 
define('HTTPS_SERVER', 'https://www.supawhip.com.au/'); 

and in /admin/config.php

// HTTP 
define('HTTP_SERVER', 'https://www.supawhip.com.au/admin/'); 
define('HTTP_CATALOG', 'https://www.supawhip.com.au/'); 

// HTTPS 
define('HTTPS_SERVER', 'https://www.supawhip.com.au/admin/'); 
define('HTTPS_CATALOG', 'https://www.supawhip.com.au/'); 
+0

仍然沒有工作,並得到它。 'This page is working' 'supawhip.com.au重定向你太多次了.' – helpfulguy