After the SSL is installed on your domain name, you will need to redirect all non-secure HTTP links to their secure HTTPS connection for several important reasons.
For any website to work over SSL, there are some modifications you will need to make to your .htaccess file, and then it will redirect your visitors to the HTTPS version of your website. To start with the process of HTTP redirection simply login to your Sangkrit.net account and follow these steps:
- Go to your product page.
- Under the Server, click Manage for cPanel
- In the Account Dashboard, click File Manager.
- In the cPanel File Manager, click Settings.
- Make sure that Show Hidden Files (dotfiles) is checked, and click Save.
- Click on public_html, and open your
.htaccess
if you already have one. If not, click File+, name the file.htaccess
and click Create New File. - Select the
.htaccess
file, and click Edit.- If you just created your
.htaccess
file, use this code:
RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteCond %{HTTP_HOST} ^(www\.)?coolexample\.com RewriteRule ^(.*)$ https://www.coolexample.com/$1 [R,L] - If your
.htaccess
file already exists, insert the lines that begin withReWriteCond
andRewriteRule
directly after the already existingReWriteEngine On
. - Click Save Changes and Close.
- If you just created your
That’s it. Visit your website and you’ll be re-directed to the HTTPS version.
How To Redirect HTTP To HTTPS In WordPress?
- Log into your WordPress Dashboard.
- Visit Settings, click General.
- Locate the following fields:
- WordPress Address (URL)
- Site Address (URL)
- In each field, update your URLs from http to https
- Scroll down and click Save Changes.
- Open your current
.htaccess
file in the/public_html/
folder with the cPanel file manager for editing. If you don’t already have a.htaccess
file, you’ll need to create one. - Insert the following code at the top of your
.htaccess
file: - Click Save Changes at the top-right corner of the screen.
In some cases, you will need to edit your .htaccess file, if you don’t want that then use a WordPress plugin like Really Simple SSL. This saves you from the technical steps edit file editing on the server.