Results 1 to 1 of 1
-
19th Sep 2015, 05:44 PM #1
SEO - 301 Cononical Redirect - Adds WWW
Issues a check to see if the "www" is included, if not, forces "www" to be appended to the URL in question.
PHP Code:<?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']);
}
?>Kevin Reviewed by Kevin on . SEO - 301 Cononical Redirect - Adds WWW Issues a check to see if the "www" is included, if not, forces "www" to be appended to the URL in question. <?php if (substr($_SERVER,0,3) != 'www') { header('HTTP/1.1 301 Moved Permanently'); header('Location: http://www.'.$_SERVER.$_SERVER); } ?> Rating: 5
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Vn5socks.net 05-11-2024 | Service...
Live | 198.7.56.71:58182 | United States |...