htaccess: Redirect all of your pages to be forced to use SSL

htaccess 19 ก.ย. 2017

Add this to your .htaccess file.

# Redirect to HTTPS
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

This should be placed directly after RewriteEngine on if you have no previous rewrites.

แท็ก

Onyx

Just a middle-aged programmer, Can do many things but not the most.