JoomlaSriLanka | Web Designer in Sri Lanka

Redirecting non-ssl HTTP to ssl HTTPS with .htaccess

If you want to redirect all HTTP requests to your web site to the SSL secured HTTPS version, all you need to do is add the following code to your .htaccess file: Needless to say that you must be running on apache with mod_ssl enabled.  You have to replace with your domain name or use the second method

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$$1 [R,L]

Second Method

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

Add comment

Security code


Latest Work UG - New Zealand web design by sri lankan design company for new zealand



Paradise Vacations : Web Design | Joomla





Fly Sri Lanka : Web Design : Joomla