Clean URL |
[eluser]Pellens[/eluser]
Hi webmasters, I have a website using the following URL: http://www.reisgoedkoop.com/index/lijst/...prijs_max/- I would like to make it shorter, is it possible to hide the controller index and function lijst? Like following: http://www.reisgoedkoop.com/type/zomerva...prijs_max/- or even http://www.reisgoedkoop.com/zomervakanti...prijs_max/- I've tried some routing, as well .htaccess but I'm not able to make it work, also I don't know if it's possible of course... Thank you very much in advance, Pellens
[eluser]crnalajna[/eluser]
in your /application/config/routes.php Code: $route['zomervakantie/(:any)'] = 'lijst/type/zomervakantie/$1'; put .htaccess in website root Code: <IfModule mod_rewrite.c>
[eluser]Pellens[/eluser]
Thank you very much! It's is working. One question: I see that the Code: $this->uri->uri_to_assoc() is this normal? It's not a problem, I made a work around, but just to know... Greetings!
[eluser]crnalajna[/eluser]
It's normal. You need to use ruri_to_assoc() instead of uri_to_assoc() after routing.
[eluser]Pellens[/eluser]
Thank you very much! Learned something new again, nice. |
Welcome Guest, Not a member yet? Register Sign In |