rAthus icon

.htaccess force HTTPS

rAthus | PRO | 01/08/19 10:06:10 AM UTC | 0 ⭐ | 792 👁️ | Never ⏰ | []
text |

390 B

|

None

|

0 👍

/

0 👎

# Force HTTPS
RewriteEngine On
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]
 # Force HTTPS without the "Too many redirects" error when behind proxy
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =http [OR]
RewriteCond %{HTTP:X-Forwarded-Proto} =""
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Comments