redirect failing on a different server |
[eluser]Phil Sturgeon[/eluser]
Recently started doing a bit of work for a client and for some reason my redirect does not work when using the URL helper. The code: Code: function index() this does not work. It takes them back to the splash.php view instead of rediecting to the "splash_thanks.php" So thats lame! When I swap: Code: redirect('/splash/thanks'); Code: header('Location: /splash/thanks'); it works fine!!
[eluser]coolfactor[/eluser]
Use Firefox's Headers feature to monitor what the redirect() function is sending to the browser. It should be using a Location redirect, by default. I use redirect() extensively on my sites, so I don't know why it wouldn't work for you.
[eluser]Phil Sturgeon[/eluser]
Exactly. I have used it hell-loads on my two sites and on a few for various clients ALWAYS with no problem. I wouldnt have thought it would matter about PHP versions or anything would it? It doesnt seem to do anything... just flops. Take a look Kicknote
[eluser]coolfactor[/eluser]
I just signed up at Kicknote and saw the Thanks page properly. Was it supposed to not work? Could it be a browser issue instead? What are you using for a browser?
[eluser]the real rlee[/eluser]
Pyro, you running PHP under IIS? Some Windows servers dont like location as noted in docs. Try using 'refresh' Code: redirect('mypage', 'refresh')
[eluser]Phil Sturgeon[/eluser]
@coolfactor: As I said I changed back to using header('location') shortly after posting as the guy was complaining it wasnt working. Cant make a client unhappy just cause im trying to fix a bit of code >.< @real rlee: redirect has two options - redirect & location (default). So this cannot be the error as the code that redirect() is using the same method as the one I pasted above... so... wtf?! |
Welcome Guest, Not a member yet? Register Sign In |