Website transition from http to https

Started by Stranger, Jul 25, 2022, 09:34 AM

Previous topic - Next topic

judii

Configure the 301 redirect [nofollow] from HTTP to HTTPS
As search engines Google and other perceive sites http://domen.com and https://domen.com as two completely different resource after you install an SSL certificate is necessary to configure the redirect every HTTP page to the corresponding HTTPS page. This procedure corresponds to the transfer of the site to another domain. Redirection should be direct and not include intermediate documents, otherwise chains of redirects will form, which will only confuse search robots and negatively affect the perception of the site as a whole.

Alternatively, you can redirect from HTTP to HTTPS using .htaccess, if your site is hosted on an Apache server, or if there is a corresponding utility on your server. In addition, if your site is created in any programming language, you can configure redirection directly in the site code.
Configure the internal linking of the website
Replace URLs from HTTP to HTTPS in all internal links, images, JavaScript, CSS and other elements. All internal links should start with HTTPS by default. This will help to avoid the problem of mixed content. However, this step can be avoided if you have properly prepared the site for the transition to HTTPS.
Check the operation of external scripts and images.
Carefully check if all external scripts and images work correctly over HTTPS. If you find any problems, it is better to upload such files to the server so that they are guaranteed to be downloaded over HTTPS.
Inform the search engines about the transition to HTTPS
Make sure that all the "rel=canonical" tags in the HTML code point to pages with HTTPS.

Update the file with the directives for the search robot robots.txt and the site map sitemap.xml by including the corresponding HTTPS pages in them.

Update the URL of your website on social networks and in traffic tracking systems such as Google Analytics.

Create a new entry for the HTTPS resource in Google Webmaster Tools. Remember that the Google Webmaster Tools service treats the site versions with HTTP and HTTPS as two different resources.

If possible, update important external links to your website so that they lead to a URL with an HTTPS extension.

Make sure that search engines can index and provide the content of your resource at the new URL.

Monitor the site with HTTPS daily in Google Webmaster Tools and in Google Analytics to prevent possible problems with indexing and displaying your site.

Remember that switching from HTTP to HTTPS can cause fluctuations in traffic volumes and site positions, since the 301st redirect transmits from 90 to 99% of the link weight. The loss of external links that previously led to the HTTP version of your resource can also temporarily trigger a drop in traffic and position. However, many examples show that positions and traffic recover within a few months after switching from HTTP to HTTPS.


Redirecting from http to https via .htaccess file
Rewrite Engine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]


This problem can also be solved using PHP
Redirect from http to https in php code:
if($_SERVER['HTTP_X_FORWARDED_PROTO']=='http') {
header("HTTP/1.1 301 Moved Permanently");
header('Location: https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
exit();
}


  •