• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple routing issue - please help!

#1
[eluser]Sven Delle[/eluser]
I have this in my routes file:

Code:
$route['default_controller'] = 'site';

$route['showcase/(:any)'] = 'site/showcase/$1';
$route['((?!admin|login).*)'] = 'site/index/$1';

Simply to remove the 'site' part from the url.

And in my Site Controller i have a function showcase.

Now I want to add a movie function and adds it to my Site Controller.

I then add this to my routes file:

$route['movie/(:any)'] = 'site/movie/$1';

But this gives me a Page Not Found Error. Now, why the h... is that happening?

#2
[eluser]weboap[/eluser]
check this article
http://bizwidgets.biz/web-design/codeign...rls-short/

#3
[eluser]Sven Delle[/eluser]
Thanks. But that doesn't solve my problem.

I have solved the idea of sending the user to anything but.

But if you look at my code, I can send users to the showcase function using:

Code:
$route['showcase/(:any)'] = 'site/showcase/$1';
$route['((?!admin|login).*)'] = 'site/index/$1';

So adding a movie function (exactly as the showcase function) to the site controller and adding:

$route['movie/(:any)'] = 'site/movie/$1';

Should work. Well, it doesn't. I even tried adding movie to the exception rule (even though showcase works fine without adding it) like so:

Code:
$route['((?!movie|admin|login).*)'] = 'site/index/$1';

There HAS to be something wrong with this routing thing, or?


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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