Jump to content

Force HTTPS to all

Recommended Posts

There are a few options available, depending on your specific setup and configuration.

RewriteEngine OnRewriteCond %{HTTPS} !^on$RewriteRule (.*) https://yourdomain/$1 [R,L]
RewriteEngine onRewriteCondition %{SERVER_PORT} !^443$RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L] 
RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]

Load balancer options

<IfModule mod_rewrite.c>    RewriteEngine On    RewriteCond %{HTTP:X-Forwarded-Proto} !https    RewriteRule (.*) https://yourdomain.com/$1 [R=301,L]</IfModule>
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...