Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- To force all web traffic to use HTTPS:
- RewriteEngine On
- RewriteCond %{SERVER_PORT} 80
- RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
- RewriteEngine On
- RewriteCond %{HTTPS} !=on
- RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
- To force a specific domain to use HTTPS:
- RewriteEngine On
- RewriteCond %{HTTP_HOST} ^example\.com [NC]
- RewriteCond %{SERVER_PORT} 80
- RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
- To force SSL on a specific directory:
- RewriteEngine On
- RewriteCond %{SERVER_PORT} 80
- RewriteCond %{REQUEST_URI} directory_name
- RewriteRule ^(.*)$ https://www.example.com/directory_name/$1 [R,L]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement