• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
route - any


I want to route every request to one controller.
I tried this but I cant get this to work:

$route[':any'] = "index";

anything with something before 'any' works just fine (like $route['product/:any'] = "index"Wink, but the above line doesnt. I tried this too

$route['([a-z]+)'] = "index/$1";

which would be even better for me, but it doesn't work either.

any ideas?

[eluser]Glen Swinfield[/eluser]
Probably best to use a .htaccess file.

i.e. when removing index.php (assuming you have) instead of this:

RewriteRule ^(.*)$ index.php/$1 [L,QSA]

do something like this:

RewriteRule ^(.*)$ index.php/index/$1 [L,QSA]

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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