Thread: Toolbar
View Single Post
Old 10-26-2007, 03:18 PM   #12 (permalink)
Jmz
The Acquainted
 
Join Date: Oct 2007
Location: Newcastle, UK
Posts: 113
Thanks: 3
Jmz is on a distinguished road
Default

Quote:
Originally Posted by bluesaga View Post
Also possible in PHP:

PHP Code:
if(substr($_SERVER['SERVER_NAME'], 03) != '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
Send a message via MSN to Jmz
Jmz is offline  
Reply With Quote