routing question - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: routing question (/showthread.php?tid=26171) Pages:
1
2
|
routing question - El Forum - 01-07-2010 [eluser]WebsiteDuck[/eluser] I think that would be easiest routing question - El Forum - 01-07-2010 [eluser]dadamssg[/eluser] i guess my question is...how do i exclude 'main' from being redirected? routing question - El Forum - 01-07-2010 [eluser]dadamssg[/eluser] im beginning to question where i shouldve put the CodeIgniter folder. I put as a folder at my root next to my index.php frontpage. Should i have just put the System folder found within the CodeIgniter there instead? I say this because all of my urls have the CodeIgniter folder in them like below http://myexample.com/CodeIgniter/index.php/form routing question - El Forum - 01-07-2010 [eluser]WebsiteDuck[/eluser] You'll have to use regular expressions Code: $route['(^[^(main)])'] = "controller/function/$1"; I don't think that works, I'm not very good at regular expressions routing question - El Forum - 01-07-2010 [eluser]WebsiteDuck[/eluser] As for the codeigniter folder question, you can get around that with an .htaccess file Code: <IfModule mod_rewrite.c> This says, if the request is not a valid file or folder, send it to /codeigniter/index.php Then, instead of http://myexample.com/CodeIgniter/index.php/form you can do http://myexample.com/form routing question - El Forum - 01-07-2010 [eluser]mcr_rm[/eluser] I think you need to do far more complex routing than that. I think you would need to overide the default index routing using remap http://ellislab.com/codeigniter/user-guide/general/controllers.html#remapping then pass the paramter through a method created in a model or otherwise to check if a user exists then if not check for other methods that could exist (for standard page routing). I have done something before outside of codeigniter that does this whereby we mod rewrite to index and first parse the routing against pages in the system before passing it to a data call to check for a saved custom page. It would be far easier to create a controller one level down so site.com/u/username but to get what you want and still make a site that can show other pages than profiles you need to do some reworking of the routing. I don't think solely using any to parse a username is good enough. routing question - El Forum - 01-07-2010 [eluser]dadamssg[/eluser] so i add that to my .htaccess file found in my root folder? |