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 domain.com with your domain name or use the second method

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

Second Method

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


Add comment


Security code
Refresh

 

Latest Work UG - New Zealand

uglydumpling.co.nz web design by sri lankan design company for new zealand

 

 

Paradise Vacations : Web Design | Joomla

 

 

paradisevacations1

 

Fly Sri Lanka : Web Design : Joomla

 

 

flysrilanka