Forcing HTTPS
Once an SSL Certificate has been successfully installed on your website, and you can visit https://yourdomain.ca and have your website content displayed as intended.
The final step will be in implement a redirect so that any future visitors to http://yourdomain.ca will be redirected to https://yourdomain.ca
Via Plesk Control Panel
The easiest way to implement a HTTP to HTTPS redirect is via the Plesk Control Panel. You will first need a valid and functioning SSL certificate installed on your website, as mentioned above. The redirect is then implemented via the following steps:
- Log into your Webnames account at https://webnames.ca
- Browse to Account > Web Hosting
- Click on your domain name
- Click on the Hosting Tab
- Under the Hosting Logins heading, click on Login for the Hosting Control Panel
- Once logged in, click on Websites & Domains
- Choose the domain to configure and click Hosting Settings
- Select both SSL/TLS support and Permanent SEO-safe 301 redirect from HTTP to HTTPS checkboxes under Security
- Select the corresponding SSL certificate from the Certificate drop-down list
- Confirm changes by clicking OK button
Your site will now utilize a secure connection for all web page requests, and any requests for http://yourdomain.ca will be forwarded to https://yourdomain.ca (as will all sub domains (e.g. www) and subfolders.
Via .htaccess file
As an alternative to using the Plesk COntrol Panel to implement a redirect, the .htaccess file within your hosting account can also be edited directly. Your .htaccess file is a configuration file used by the web server software to provide a way to make configuration changes on a per-directory basis.
- Log into your Webnames account at https://webnames.ca
- Browse to Account > Web Hosting
- Click on your domain name
- Click on the Hosting Tab
- Under the Hosting Logins heading, click on Login for the Hosting Control Panel
- Once logged in, click on Websites & Domains
- Choose the domain to configure and click File Manager
- In the list of files present in your hosting, locate and click on the file named .htaccess
Redirecting HTTP to HTTPS
Redirect All Web Traffic
At the top of your .htaccess file , add the following text and then save:
RewriteEngine OnRewriteCond %{SERVER_PORT} 80RewriteRule ^(.*)$ https://www.yourdomain.ca/$1 [R,L]
Redirect a Specific Domain Only
To redirect a specific domain to use HTTPS, add the following text and then save:
RewriteEngine OnRewriteCond %{HTTP_HOST} ^yourdomain\.ca [NC]RewriteCond %{SERVER_PORT} 80RewriteRule ^(.*)$ https://www.yourdomain.ca/$1 [R,L]
Redirect a Specific Folder Only
To redirect HTTP to HTTPS for a particular folder only, add the following text and then save:
RewriteEngine OnRewriteCond %{SERVER_PORT} 80RewriteCond %{REQUEST_URI} yourfolderRewriteRule ^(.*)$ https://www.yourdomain.ca/youfolder/$1 [R,L]