Routing for beginners

#1
[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!

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

#3
[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.

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

#5
[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.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.