Two ways to force SSL on your website
Submitted by linportal on Fri, 2007-04-20 01:47
Two solutions, both to be put in the .htaccess file, when you want to force your website visitors to go through SSL:
Solution A:
RewriteEngine On
RewriteCond %{SERVER_PORT} !443$
RewriteRule ^(.*)$ https://www.example.com/$1 [L,R]
Solution B:
RewriteEngine on
RewriteCond %{HTTPS} !^on$ [NC]
RewriteRule . https://%{HTTP_HOST}%{REQUEST_URI} [L]
Pick whatever solution looks nicer for you.
»
- linportal's blog
- Add new comment
- 16296 reads








Recent comments
10 hours 23 min ago
4 weeks 3 days ago
4 weeks 3 days ago
6 weeks 1 day ago
10 weeks 1 day ago
12 weeks 1 day ago
12 weeks 1 day ago
12 weeks 1 day ago
12 weeks 5 days ago
16 weeks 1 day ago