Redirect, it works only with one parameter |
[eluser]Alhazred[/eluser]
If a wrong page is requested I want to show a "page not found" view. To do this I'm using the redirect() function, but I'm having a problem. If I use redirect('/home/page_not_found'); the page is shown while if I use redirect('/home/page_not_found', 'location', 404); I get a blank page. There is no output before the redirect function, what can cause the problem?
[eluser]TWP Marketing[/eluser]
redirect() is a CI URL helper function and only accepts the URL parameter. If you want to use more parameters, try the full php http_redirect() Check the User Guide for the specifics of the helper function. bottom of this page: http://ellislab.com/codeigniter/user-gui...elper.html
[eluser]Alhazred[/eluser]
I read the user guide, and that's why I was using that syntax. In the user guide you can read what follows Quote:redirect()
[eluser]TWP Marketing[/eluser]
You're correct. Is your redirect() being issued before any attempts to load a view (or fractional view) to the browser? For instance, do you load some header view(s) before making a conditional test for the existence of a page which might trigger redirect? I assume this conditional statement is in your controller. Did you set $route['404_override'] for the default router to use on 404's? |
Welcome Guest, Not a member yet? Register Sign In |