[Secret] 404 errors |
[eluser]@li[/eluser]
Hi, On the latest version of CI, I'm getting a 404 error if I try to go to a URL such as: http://localhost/blog/admin/create/123/ Blog is the directory where my app is placed. I do have a directory called 'admin' in application/controllers, and there's a controller called 'create.php' in that directory as well. Simply going to http://localhost/blog/admin/create/ works, but if I put something else after the URL, (e.g the /123/), I get a 404 error. I need to pass on some information to the controller through the URL, so I must be able to add more segments to it. I found that in system/libraries/Router.php, on line #177, changing: $this->set_method($segments[1]); to: $this->set_method($segments[0]); fixes this, but it causes CI to give a 404 error in some other places. Has anybody else noticed this problem? Any ideas?
[eluser]Glen Swinfield[/eluser]
http://localhost/blog/admin/create/ --- is calling the index() action of the Create controller, http://localhost/blog/admin/create/123 --- is calling the 123 action of the create controller, unless you tell it otherwise in the routes.php file. ??? $route['create/:any'] = "admin/create/index"; Or have I misread your question?
|
Welcome Guest, Not a member yet? Register Sign In |