Some help.. |
[eluser]xwero[/eluser]
Remove the url suffix and you should be able to reach http://www.site.com/lists/1. I'm not sure if you use the url suffix configuration is removed before the url is routed so you could try Code: $route['/([a-z]+)/(\d+)\.html'] = "main/$1/$2";
[eluser]adamp1[/eluser]
Wait so why not have make it so each static page has its own controller, instead of each static page having a method in a controller?
[eluser]oriceon[/eluser]
http://localhost/site/lists.html 404 Page Not Found
[eluser]oriceon[/eluser]
Because this is the single method find by me to not showing controller in URL. I want static pages to not show controller..
[eluser]adamp1[/eluser]
Right well I just built the system you described on my server using the following routes: Code: $route['default_controller'] = "main"; And it works, btw you don't put the .html into the regex
[eluser]xwero[/eluser]
I confirmed it the url suffix is removed before the routes are parsed so the suffix doesn't matter The http://localhost/site/lists.html example doesn't work because it's not in the routes configuration, you need to add Code: $route['/([a-z]+)'] = "main/$1"; edit: @adamp1 i wasn't sure so it could have been the problem, but it isn't
[eluser]oriceon[/eluser]
Still doesn`t work :| I`ve trying both examples and nothing.. same 404
[eluser]xwero[/eluser]
First i want to make sure: http://localhost/site/ is your base url, right? edit : i made a newbie mistake, again, the slash at the beginning of the route Code: $route['([a-z]+)'] = 'main/$1';
[eluser]adamp1[/eluser]
Yer, Im never sure with damn regex and routing, that's why I had to go and build it to see myself.
[eluser]adamp1[/eluser]
Wait a sec, are you making the call to index.php??? you should be accessing Code: http://localhost/site/index.php/lists/1.html You can only miss the index.php out of you have url re-writing in an .htaccess file |
Welcome Guest, Not a member yet? Register Sign In |