Https Redirect Using X-Forwarded-Proto - Htaccess

How to redirect http to https using HTTP:X-Forwarded-Proto in .htaccess?

Snippet Code


  
Rate this page :
  [ 0 votes]

Here, HTTP:X-Forwarded-Proto property is used in .htaccess which redirects http to https.

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

Tags


Ask Questions

Ask Question