10-26-2007, 03:18 PM
|
#12 (permalink)
|
|
The Acquainted
Join Date: Oct 2007
Location: Newcastle, UK
Posts: 113
Thanks: 3
|
Quote:
Originally Posted by bluesaga
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
|
Doesnt seem to be working :confused:
http://jamesowers.co.uk/cms/add.php
|
|
|