301 Redirect for WWW. or NO www.
Autor: Timothy S.
Visited 2263,
Followers 3,
Udostępniony 0
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']); } ?-->Posted on the