Link to home
Start Free TrialLog in
Avatar of jagku
jagkuFlag for United States of America

asked on

php header redirect modifying the URL

Hello Experts,

I have the following code:

<?
header('Location:http://www.abc.com') ;
exit;
?>

Open in new window


However, when I access this script, this redirects to:

http//www.abc.com

ie it is missing off the ":"

Any ideas why this is occurring?

Thanks!
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Is there any more to the code, or is that the complete script?

Please post the URL that illustrates the behavior, thanks.
I am unable to reproduce the behavior with this script.

<?php // RAY_temp_jagku.php
error_reporting(E_ALL);
header('Location:http://www.abc.com');
exit;

Open in new window

Avatar of jagku

ASKER

Thanks Ray,

I literally have those 2 lines of text.
I added error_reporting(E_ALL);  but nothing appears on the screen and the browser is still trying to redirect to http://www.abc.com

I am using Firefox.

Thanks
SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jagku

ASKER

Thanks for the above suggestions.
I will try them all out later on tomorrow.

Note: www.abc.com is just an example. It happens to any domain.
I'll post what has cracked the problem.

Thanks!
Avatar of jagku

ASKER

Hi,

Ok, I worked out what the problem was - for some reason I was redirecting to

http://http:// 

Schoolboy error.

Nevertherless, thank you for your help - I have awarded everyone that helped some points.