How to switch from HTTP to HTTPS?


Please, do the following:


 1. Buy and install SSL Certificate on your web server:


 2. Update all Hard-coded Links to HTTPS

  It is always best practice to use relative URLs, but there will always be times when someone has hard-coded a URL and so you will want to do a full sweep on your site and database during an HTTP to HTTPS migration.


 3. Update Custom JS, AJAX Libraries to HTTPS

  Update any custom scripts you may have included so that they point to the HTTPS versions. This also includes 3rd party hosted scripts.

  Also scan your Website for Non-Secure Content.


 4. Add 301 Redirects to New HTTPS URLs



Add the following to your Nginx config:

server {
listen 80;
return 301$request_uri;



Add the following to your .htaccess file:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]


  More about redirects here:


 5. Update your robots.txt File

  Update any hard-coded links or blocking rules you might have in your robots.txt that might still be pointing to HTTP directories or files.


 6. Inform Google about the change in URL

  Re-add your website to Google Webmaster Tool (but this time with https://) and follow this guide to let Google know about the change of URL:





Was this information helpful?

It would also be interesting

Copied to clipboard