This is a pretty common scenario, you want all of your users to be taken to the HTTPS version of your site. This should be pretty straight forward, however that is not always the case. Since moving to hosting with cPannel, i had to figure out how to get this working. When i was using my Synology NAS it would do the work for me.
Luckily the process for getting it working is very simple. You simply place a .htaccess file in the root of your web folder. so these are the steps.
-
- Open notepad and type in the following:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L] - Next save this file, when you click save make sure you select “all files” from the drop down and make the name “.htaccess“. Ensure that there is no .txt after the name.
- Once this file is saved you can then upload it to your web host. Ensure that you put it in the root directory of your site. (Where your index file is).
- I have also attached the file here so you can just download it. htaccess File Download
- Open notepad and type in the following:
Recent Comments