How to Remove Index from URL |
[eluser]pdxbenjamin[/eluser]
Yes yes, I know how to remove it from the root directory using .htaccess that works fine. Code: <IfModule mod_rewrite.c> However, I've created a new folder in my views /views/roll/ I'm trying to organize my code a bit better in folders. In the controller called roll.php i've made a few functions starting out with index(). I'm trying to grab the username ie, http://site.com/roll/jdoe Code: function index() But, to do that the url is http://site.com/roll/index/jdoe How do I get the .htaccess to remove that INDEX? Thanks.
[eluser]Samus[/eluser]
You don't. index is a method in your controller so it is displayed as every other url is. siteurl.com/controller/method/param1/param2 If you don't want the index to appear in your url use routes. http://ellislab.com/codeigniter/user-gui...uting.html e.g Code: $route['roll/(:any)'] = "roll/index/$1";
[eluser]pdxbenjamin[/eluser]
Ahhhhhh Thank you. I always forget about Routes |
Welcome Guest, Not a member yet? Register Sign In |