Need to get our website to resolve to our secure pages.
Seems like the best way, in terms of SEO, is via a 301 redirect.
Would this code be a 301 redirect?
if($_SERVER['HTTP_X_FORWARDED_PROTO']=="http"){
header('Location:https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
exit;
}
Open in new window
Or, will this be looked at as, not only NOT 301, but somehow seemingly the WRONG way to achieve our goal and result in a SEO penalty?
Many thanks!
OT