CodeIgniter Forums
how to use mod rewrite - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: how to use mod rewrite (/showthread.php?tid=8955)



how to use mod rewrite - El Forum - 06-06-2008

[eluser]PHPraja[/eluser]
in my project i have the urls like
Code:
http://localhost/proj/index.php/user/login
http://localhost/proj/index.php/place/place_create/228
http://localhost/proj/index.php/event/DisplayEventDetails/444/Summary

but i want to have clean urls.
Can any one help me how can i do this. Is mod rewrite concept solves this problem. If so can any one guide me how to use mod rewrite concept as i have nill knowledge of it.

Thanks in advance..


how to use mod rewrite - El Forum - 06-06-2008

[eluser]Michael Wales[/eluser]
What exactly are you wanting to clean-up? The index.php? User Guide tells you how to do that.


how to use mod rewrite - El Forum - 06-08-2008

[eluser]PHPraja[/eluser]
hi lab technician, thanks for your reply. to get rid of index.php i followed the steps given in
Code:
http://codeigniter.com/wiki/mod_rewrite/

i could get rid of index.php, but i want the url still more clean
Code:
http://localhost/proj/place/Displayplacedetails/267/summary
http://localhost/proj/event/displays/35


ie, for eg in the above urls can i get rid of the controller name and functions and ids too? so that the users of the site can not see the ids and other parameters.
Is there any other way to solve my problem?

Thanks for your help in advance.


how to use mod rewrite - El Forum - 06-08-2008

[eluser]garymardell[/eluser]
You cannot get rid of the controller name and function as codeigniter framework will not know where to look for the code you are trying to execute. You can use routing to change the names though (see user guide).