Routing question |
[eluser]pepijn744[/eluser]
Hi, I'm entering the final stage of the project I'm working on right now and I want to add a routing feature. Say, my site is www.site.com. I want to redirect all of the first URI segment, except for /register, /contact, /aboutus, to /profile/show/$1. Is something like that possible? I'm already using the mod_rewrite, so no www.site.com/index.php/(.*) anymore. Thanks in advance.
[eluser]richthegeek[/eluser]
routes are executed in the order that they are listed, and matching one stops the execution of the rest. As such, having your routes looking something like this: Code: $routes['register'] = '/users/register'; Should sort you out.
[eluser]pepijn744[/eluser]
Thanks! It works now. I have to correct you on the variable name, it is $route instead of $routes.
[eluser]richthegeek[/eluser]
Sorry,haven't used routes in a while so was writing from memory
[eluser]pepijn744[/eluser]
You helped me out so no problem I have another question... I'm adding an extern forum in /forum/, can i make an exception for this folder so it doesn't go to CodeIgniter? I think I'll have to change .htaccess for this. Can anybody help me out? I'm not so good at this area.
[eluser]richthegeek[/eluser]
the htaccess only redirects if there is no physical location at that adress... Which is why your /CSS and/or /assets folder work
[eluser]pepijn744[/eluser]
Oops I see! Thank you, I will not bother you anymore. |
Welcome Guest, Not a member yet? Register Sign In |