Click to See Complete Forum and Search --> : .htaccess Rewrite Rule-to restrict site access to https://


keerthi
05-02-2006, 05:40 AM
Hi

i want to restrict the access to the site other than https:// is given.otherwise the site should not be accessible using .htaccess

please help

Thanks

keerthi
05-02-2006, 05:52 AM
http://ccfaq.valar.co.uk/modules.php?name=News&file=article&sid=242

Scleppel
05-02-2006, 10:17 AM
If you want to redirect users from http to https, you can use this:
RewriteEngine On

RewriteCond %{SERVER_PORT} !^443$
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [QSA,R=301,L]