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




- 4824 reads

Recent comments
5 hours 28 min ago
1 day 8 hours ago
1 day 9 hours ago
2 days 5 hours ago
3 days 10 hours ago
3 days 22 hours ago
1 week 3 days ago
1 week 5 days ago
2 weeks 2 days ago
2 weeks 3 days ago