Mobile app version of vmapp.org
Login or Join
Martha676

: Switching to HTTPS - redirect question Following the recent Google announcements about improved ranking for sites running on https we have a number of clients asking about this. Is it safe to

@Martha676

Posted in: #Https #Php #Redirects #Seo

Following the recent Google announcements about improved ranking for sites running on https we have a number of clients asking about this. Is it safe to just 301 redirect all pages to their SSL equivalent, for example in a common PHP include file:

if($_SERVER['HTTPS']!="on"){
$redirect= "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
header("Location:$redirect",true,301);
exit();
}


Obviously I'm aware this is also possible within a .htaccess file but that cannot be modified in our case.

Obviously all internal links would be switched to links but obviously we need to sort out incoming links from Google and elsewhere.

Is this a sound approach? Are there any other gotchas to be aware of?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Martha676

2 Comments

Sorted by latest first Latest Oldest Best

 

@Gloria169

It also depends on Competition.
For example, I saw 2-3 sites from the 2th page in google.gr with https to come on 1th page.

As Google says it has affected 1% till now.

10% popularity Vote Up Vote Down


 

@Jessie594

Perfectly fine to 301 redirect all HTTP pages to their HTTPS equivalent. Either via httpd.conf on Apache servers, .htaccess rewrites or with a PHP include like your example. Any inbound links would pass about 97% of weight through a 301 redirect.

The best handling internally would be to not use the protocol for internal linkage so that compatibility is maximised sitewide with minimal intervention.

Https as a ranking signal is minimal, it is also not even categorically confirmed that there are site ranking benefits to be had by serving all URL's over https (this algorithm change affects on a per URL basis). That said however, John Mueller at Google recently confirmed that if you already have TLS on the domain, switching everything over to https ought to be a no-brainer (so more for the benefit of visitor trust than rankability).

This isn't straight forward of course for every site depending on the amount of embedded content it may have that is served on http within HTTPS pages (e.g. put an iframe, script, image, etc. that uses HTTP on a page that uses HTTPS). In any instances such as this, visitors could be seeing the red cross over the padlock or red/yellow browser warnings constantly on a site without each of these instances being taken care of and handled appropriately.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme