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




- 5205 reads

Recent comments
1 week 3 days ago
1 week 6 days ago
1 week 6 days ago
2 weeks 7 hours ago
3 weeks 1 day ago
3 weeks 1 day ago
3 weeks 2 days ago
3 weeks 6 days ago
4 weeks 1 day ago
5 weeks 1 day ago