WebSite X5Help Center

 
Timothy S.
Timothy S.
User

301 Redirect for WWW. or NO www.  en

Autore: Timothy S.
Visite 2235, Followers 3, Condiviso 0  
Parole Chiave: redirect,single,site

301 redirects code for your single website so you have the www. or NO www. so it will help your rankings on search engines. Post this code in the properties part of your home page only under the expert tab.

<?php
if (substr($_SERVER['HTTP_HOST'],0,3) != 'www') {
header('HTTP/1.1 301 Moved Permanently');
header('Location: http://www.'.$_SERVER['HTTP_HOST']
.$_SERVER['REQUEST_URI']);
}
?>


COPY AND PASTE EXACTLY AS ABOVE DO NOT CHANGE ANYTHING

<!--?php if (substr($_SERVER['HTTP_HOST'],0,3) != 'www') { header('HTTP/1.1 301 Moved Permanently'); header('Location: http://www.'.$_SERVER['HTTP_HOST'] .$_SERVER['REQUEST_URI']); } ?-->
Postato il