Force HTTPS / SSL connections on your website

If you're using software such as WordPress, then it's best to simply set the wordpress site url in WP Admin / Settings to use https:// instead of http:// - it should be as simple as that. You ca

 

You can also use a rewrite in htaccess to achieve this. If you'd like to try this, please follow the below instructions.


You can do this using FTP, or using File Manager in cPanel.

To log in to cPanel, go to 'My Services' -> 'View Details' and click the 'Login to cPanel' button.

Now click File Manager and click the public_html (or the folder for the site if it's an addon domain/sub domain etc).

If you are unable to see a .htaccess file you may also need need to click 'Settings' in the top right and tick the box next to 'Show Hidden Files' and press Save.

If there is still no .htaccess file visible after enabling the above option, simply click the '+ File' button and create a file called .htaccess

Once you've opened .htaccess add the below code.

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

Note: Replace example.com with your domain name.

If this causes your website to stop working properly, simply remove the above from your .htaccess file.

If your website is using HTTPS but says some items may still be insecure (or similar) then you may have images or other resources hard coded to use http:// urls - for example image, css or js files may be hard coded as http:// - to fix this you should review your websites source code, which you can generally do by visiting your website and right clicking and selecting view source code, or by using the F12 key to open Developer view and viewing the source code.

Do a search for http:// - if there are any results, you'll need to edit these urls to use https:// to resolve the issue. 



Was this answer helpful?

Add to Favourites
Print this Article

Also Read
Official cPanel Manual (Views: 2479)
Official WHM Manual (Views: 2251)
PHP Time Zone Errors (Views: 670)