• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Clean URL

Hi webmasters,

I have a website using the following URL:

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

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,

in your /application/config/routes.php
$route['zomervakantie/(:any)'] = 'lijst/type/zomervakantie/$1';

put .htaccess in website root
<IfModule mod_rewrite.c>

    Options +FollowSymLinks
    RewriteEngine on

    # NOTICE: If you get a 404 play with combinations of the following commented out lines
    #AllowOverride All
    #RewriteBase /cms

    # Send request via index.php (again, not if its a real file or folder)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    <IfModule mod_php5.c>
        RewriteRule ^(.*)$ index.php/$1 [L]

    <IfModule !mod_php5.c>
        RewriteRule ^(.*)$ index.php?/$1 [L]


Thank you very much! It's is working.

One question:
I see that the
is not working anymore,
is this normal? It's not a problem, I made a work around, but just to know...


It's normal.
You need to use ruri_to_assoc() instead of uri_to_assoc() after routing.

Thank you very much!
Learned something new again, nice.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.