Welcome Guest, Not a member yet? Register   Sign In
How to redirect() to an external URL?
#1

[eluser]Sinclair[/eluser]
Hi,

I need to redirect to an external URL like http://www.twitter.com, how can I do this with the CodeIgniter tools? The redirect() is only for local URLs.

Give me a clue.

Best Regards,
#2

[eluser]Ben Edmunds[/eluser]
You can use PHP's header().
#3

[eluser]nelson.wells[/eluser]
In 1.7.2 (maybe earlier, I can't be sure), you can use the redirect method to redirect to an external site by giving the address http instead of just a segment

Code:
redirect("http://www.externallink.net");

Take a look at the source code for that function Wink
#4

[eluser]Ben Edmunds[/eluser]
Nice find Nelson.

Too bad the docs don't say that but oh well, thanks for the info.
#5

[eluser]nelson.wells[/eluser]
Yea, that's not the only thing that I remember seeing not in the docs. I can't recall any others off-hand, but I know they're there... maybe I should go through some things and see what I can find. Any idea where I could submit changes / fixes / updates to the docs when I find them?




Theme © iAndrew 2016 - Forum software by © MyBB