Page 1 of 1

PHP Url redirect problem

Posted: Tue Nov 23, 2010 3:09 pm
by ravo
Hi all,
The problem im facing is-
say I have a site hosted at - http://www.abc.com/one/myApp
now in one of the html page in my application has url pointing to external address for eg. http://www.google.com. So now when i click on that url, i am suppose to be redirected to google page. But this is not happening. Instead its redirecting to http://www.abc.com/one/www.google.com. So here my redirect is failing. I tried putting a redir.php with
header(locaton:"www.google.com") code. but it also failed.

Please help me how to fix this url redirecting issue.

Thanks,
Ravi

Re: PHP Url redirect problem

Posted: Tue Nov 23, 2010 5:57 pm
by Pazuzu156
Thats simple, anytime you are connecting to another address, "http://" is always required, or else it will say that the link you click is on your website. so fix www.google.com to http://www.google.com/ and that should fix your problem