Problems with function call |
[eluser]Honscho[/eluser]
Hi there, I am fairly new to CI and I am encountering an issue that I haven't had before. I recently installed CI again for a project and for some strange reason I am not able to call another function via an URI segment. I have set the route to: Code: $route['default_controller'] = "start"; In the Start controller I have the following code: Code: <?php Now, this URL will work: http://localhost/foldername/ http://localhost/foldername/index.php And those wont: http://localhost/foldername/index.php/test (while this gives me the internal CI error 404) http://localhost/foldername/test (this gives me the browsers error 404) I assume that with the first error message I am still within CI and the second error I am getting an actual "document not found error". I have done this before but for some stupid reason I am unable to find the mistake. Anyone has an idea or a hint? I would be very happy for some advice! Thanks in advance!
[eluser]Honscho[/eluser]
Hm, now I am really confused. How is this working: http://localhost/foldername/index.php/blog/ http://localhost/foldername/index.php/blog/comments Code: <?php But my example in the previous post not?
[eluser]danmontgomery[/eluser]
http://ellislab.com/codeigniter/user-gui...ml#default Quote:CodeIgniter can be told to load a default controller when a URI is not present, as will be the case when only your site root URL is requested. localhost/foldername/test isn't looking for the test() method in the default controller, it's looking for the test controller.
[eluser]Honscho[/eluser]
God, I am such a tool. You are right of course. This is now working. Code: http://localhost/foldername/index.php/start/test To make it work like this I would have to modify the htaccess file, right? Code: http://localhost/foldername/start/test Since I never really had to do that I was wondering if anyone has a link to an article somewhere that would tutor me in the right direction Thanks!
|
Welcome Guest, Not a member yet? Register Sign In |