301 Redirect for WWW. or NO www.
Автор: Timothy S.
Просмотрено 2271,
Подписчики 3,
Размещенный 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']); } ?-->Размещено