Condition redirect not working any insights??
Posted: Mon Sep 26, 2005 10:02 am
Ok im a cold fusion person dabling in a little php so alittle help will save me alot of time;
I'm trying to do a redirect from a page http://www.thewordismusic.co.uk to http://www.wordismusic.co.uk/mobile.php if the URL used is http://www.ucbmobile.co.uk
I created the following code after readin a few forums;
<?php if ( $_SERVER["HTTP_HOST"] == 'www.ucbmobile.co.uk')
{header("Location: http://www.thewordismusic.co.uk/mobile.php");}
EXIT;?>
However I get the following error message;
Warning: Cannot modify header information - headers already sent by (output started at D:\Sites\thewordismusic.com\web\index.php:4) in D:\Sites\thewordismusic.com\web\index.php on line 5
Is there a way i can check the host and redirect the page at the same time ?
I'm trying to do a redirect from a page http://www.thewordismusic.co.uk to http://www.wordismusic.co.uk/mobile.php if the URL used is http://www.ucbmobile.co.uk
I created the following code after readin a few forums;
<?php if ( $_SERVER["HTTP_HOST"] == 'www.ucbmobile.co.uk')
{header("Location: http://www.thewordismusic.co.uk/mobile.php");}
EXIT;?>
However I get the following error message;
Warning: Cannot modify header information - headers already sent by (output started at D:\Sites\thewordismusic.com\web\index.php:4) in D:\Sites\thewordismusic.com\web\index.php on line 5
Is there a way i can check the host and redirect the page at the same time ?