10-26-2007, 02:44 PM
|
#11 (permalink)
|
|
Super Moderator
Join Date: Sep 2007
Posts: 165
Thanks: 0
|
Also possible in PHP:
PHP Code:
if(substr($_SERVER['SERVER_NAME'], 0, 3) != 'www') redirect301('http://www.' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']);
function redirect301($szLoc) { header('HTTP/1.1 301 Moved Permanently'); header('Location: ' . $szLoc); exit; }
This will redirect any url that doesn't have www at the very beginning to www version of the url
|
|
|
|