Here are instructions on how to change your website from HTTP to HTTPS That is, for your website link to show https:// instead of http://.
This is using my example of using Wordpress that is hosted on GCP (Google Cloud Platform) and using the Bitnami version of Wordpress.
My guide here aims to compliment with some examples and colour on the Bitnami guides.
This is an example from Bitnami.
Here is a step-by-step guide on how to do this.
Please note that this assumes that you have logged onto your GCP (Google Cloud Platform) and have opened up SSH for your server on your computer.
We will need to access /opt/bitnami/nginx/conf/bitnami/bitnami.conf in sudo mode so we have permissions to edit.
sudo nano /opt/bitnami/nginx/conf/bitnami/bitnami.conf
Add the following lines to your config file. This will tell the system to redirect visitors to your website with the HTTPS.
# add to HTTP section
if ($host != "dejavuguides.com") {
return 301 http://$host$request_uri;}
}
# add to HTTPS section
if ($host != "www.dejavuguides.com") {
return 301 https://www.dejavuguides.com$request_uri;
}
Example below
Save the config updates when you're ready. On a Mac, you can do this by pressing Control + O (Write Out) and accepting the write updates.
We will then need to restart our server for changes to be update. I am using ngnix for my server, so I will restart my using the following script:
sudo /opt/bitnami/<a rel="noreferrer noopener" href="http://ctlscript.sh/" target="_blank">ctlscript.sh</a> restart nginx
References and more details available here: