Knowledge Base

We are not offering 24/7 telephone support at this time, please open a Support Ticket

  • knowledgebase
  • announcements
Search

Most Popular
Recently Added
Recently Updated

Using Apache .htaccess to force redirection of web site pages (http://) to the secure site (https://)

For those whose web sites are not hosted on one of our Plesk servers, here is a way to force redirect the unsecure http:// to secure connection (https://) with Apache .htaccess.

It can be accomplished by creating a file named .htaccess (The name starts with a dot) containing these lines:

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

The .htaccess file should be uploaded in the web site main folder.

In case you wish to force HTTPS only for a particular folder you can use:

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

The .htaccess file should be uploaded in the folder where you need to force HTTPS.

On web sites hosted on one of our Plesk shared servers or VPS, you can do that from the domain subscription's Plesk Panel.


Properties ID: 000220   Views: 6519   Updated: 4 years ago
Filed under:
Support » Web Site » Web Hosting » Web Site Security

For news and system status updates, check: status.his.com

Check our Knowledge Base for How-To tips and answers to common questions.

We are not offering 24/7 telephone support at this time, please open a Support Ticket