CodeIgniter Forums
Routing for beginners - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: Routing for beginners (/thread-9140.html)



Routing for beginners - El Forum - 06-13-2008

[eluser]José Mota[/eluser]
Hello, friends.

I'm having a lot of trouble on routing. I have this simple rule:
Code:
$route['signup'] = "users/signup";
I have a controller named Users with a function called signup.

It's not working... I get a direct 404 from Apache. What should I do?

Thanks for the help!


Routing for beginners - El Forum - 06-13-2008

[eluser]ontguy[/eluser]
Does the 404 only happen when you use the segment "signup"? Does "users/signup" work?


Routing for beginners - El Forum - 06-13-2008

[eluser]José Mota[/eluser]
"users/signup" doesn't work either. :S

One thing. Do I have to put index.php/ EVERYTIME I want to create a URL?

EDIT: Problem solved! I had forgotten to put "index.php/" before the URL. Sorry.


Routing for beginners - El Forum - 06-16-2008

[eluser]Colin Williams[/eluser]
You can use mod_rewrite (on Apache) to remove the index.php part. See http://codeigniter.com/wiki/mod_rewrite/


Routing for beginners - El Forum - 06-16-2008

[eluser]xwero[/eluser]
José you can use the site_url function from the url helper to prevent forgetting to add the index.php to your urls.