Redirect HTTP to HTTPS using .htaccess

The below code when added to an .htaccess file will automatically redirect any traffic destined for http: to https:

.htaccess code here:
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Post a Comment

0 Comments

Close Menu