How to switch from HTTP to HTTPS?

 

Please, do the following:

 

 1. Buy and install SSL Certificate on your web server: https://cleantalk.org/help/install-ssl-certificate

 

 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

 

  Nginx


Add the following to your Nginx config:

server {
listen 80;
server_name domain.com www.domain.com;
return 301 https://domain.com$request_uri;
}

 

  Apache


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: https://moz.com/learn/seo/redirection

 

 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: https://w3guy.com/change-wordpress-domain-url-seo/

 

Sources:

https://www.keycdn.com/blog/http-to-https

https://designmodo.com/wordpress-https

 

 

Was this information helpful?

No

Yes




Perhaps it would also be interesting