Welcome Guest, Not a member yet? Register   Sign In
Redirect to absolute URL
#3

[eluser]maesk[/eluser]
That's one reason why I love CodeIgniter: you have a question, you get an answer in 5 minutes on the forums... awesome!
However, I probably didn't explain properly what I wanted to achieve. Your solution would just redirect me to my homepage (the base_url), but that's not what I want.

Let's say I want to be redirected to

Code:
http://www.mypage.com/controller1/function1

when I am at

Code:
http://www.mypage.com/controller2/function1/

I can't just do a

Code:
redirect('controller1/function1');

because this would take me to the URL http://www.mypage.com/controller2/functi.../function1

If I use

Code:
redirect(site_url('controller1/function1'));

it would take me to http://www.mypage.com/controller2/functi.../function1

It would be useful if the redirect() function could be used relative AND absolute, for example when it would use an absolute URL as soon as site_url() is included.
But I guess I have to use something like custom routes for this.

Edit: some of you are probably going to suggest to simply remap controller1/function1 to controller2/function1 but I want to redirect only under certain conditions, such as when there are no params in the URL but POST data exists.


Messages In This Thread
Redirect to absolute URL - by El Forum - 12-09-2008, 07:59 AM
Redirect to absolute URL - by El Forum - 12-09-2008, 08:04 AM
Redirect to absolute URL - by El Forum - 12-09-2008, 08:17 AM
Redirect to absolute URL - by El Forum - 12-09-2008, 08:23 AM
Redirect to absolute URL - by El Forum - 12-09-2008, 08:31 AM



Theme © iAndrew 2016 - Forum software by © MyBB