2017-08-02 4 views
0

Donc, j'aide un mec à rediriger toutes les requêtes HTTP vers HTTPS mais continue d'obtenir une erreur de boucle lors de l'ajout de l'un de ceux-ci dans .htaccess.Forcer la redirection HTTP vers 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 

Ceci est un hébergement partagé (si cela est important). Ceci est le fichier phpinfo et ne suis pas trop sûr comment je peux utiliser ce via .htaccess comme ce que this guy suggested

_SERVER["https_proxy"] 

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

Répondre

1

Dans .htaccess essayez ceci:

<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> 

aussi dans /config.php

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

et à /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

Toujours pas fonctionnant et d'obtenir ceci. Cette page ne fonctionne pas 'supawhip.com.au vous a redirigé trop souvent. – helpfulguy