Welcome Guest, Not a member yet? Register   Sign In
How do you do a simple redirect?
#1

[eluser]tomdelonge[/eluser]
I keep trying, but weird things happen.

Once it is supposed to redirect, it takes forever, and then the browser says:

The connection has timed out
The server at localhost.com is taking too long to respond.

But the weird thing is then the url in the address bar is the one I was trying to redirect to...

Is this not how to do it?: (I have the url helper loaded)
Code:
function testing()
    {
        if ( ! $this->session->userdata('logged_in'))
        {
             redirect('/admin/');
        }

    }
#2

[eluser]Dam1an[/eluser]
What happens if you try just
Code:
redirect('admin');
The slashes shouldn't make a differance but just in case
Also, if you go to that page directly, does it work ok?
#3

[eluser]tomdelonge[/eluser]
Yeah if I go right to "localhost/admin" everything works fine. I removed the slashes, but to no avail... Is the redirect intended to be used the way I am?
#4

[eluser]Dam1an[/eluser]
try setting the second parameter to refresh
#5

[eluser]tomdelonge[/eluser]
It still doesn't work.

Another thing I just noticed is that after it has the correct url in the address bar, if i go and click on the address bar and press enter, it goes through the same charades (taking forever, with a "problem loading page" thing from firefox.
#6

[eluser]tomdelonge[/eluser]
Another thing I noticed is that if I set redirect with "refresh" or "location", the correct url doesn't end up in the address bar.




Theme © iAndrew 2016 - Forum software by © MyBB