Skip to main content
added tag
Link
unor
  • 21.9k
  • 3
  • 47
  • 118
Tweeted twitter.com/#!/StackWebmasters/status/500228072336265216
edited title
Link
Zistoloen
  • 10k
  • 6
  • 36
  • 59

Switching to httpsHTTPS - redirect question

Formatting + removed useless text
Source Link
Zistoloen
  • 10k
  • 6
  • 36
  • 59

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'mI'm aware this is also possible within a .htaccess.htaccess file but that cannot be modified in our case.

Obviously all internal links would be switched to https://https:// links but obviously we need to sort out incoming links from googleGoogle and elsewhere.

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

Thanks.

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 https:// 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?

Thanks.

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 https:// 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?

Source Link
robjmills
  • 329
  • 3
  • 10
Loading