Force redirection to SSL for websites Print

  • 0

If you want to force your entire website to go through https, you can add these rules to your .htaccess file:

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


If your site is in a subfolder, use this code:

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


Simply replace yourdomain.com with your actual domain name.

Was this answer helpful?

« Back