Welcome Guest, Not a member yet? Register   Sign In
Some help..
#11

[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";
#12

[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?
#13

[eluser]oriceon[/eluser]
http://localhost/site/lists.html 404 Page Not Found
#14

[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..
#15

[eluser]adamp1[/eluser]
Right well I just built the system you described on my server using the following routes:
Code:
$route['default_controller'] = "main";
$route['scaffolding_trigger'] = "";

$route['lists/(\d+)'] = 'main/lists/$1'

And it works, btw you don't put the .html into the regex
#16

[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";
for that url to be routed.

edit: @adamp1 i wasn't sure so it could have been the problem, but it isn't Smile
#17

[eluser]oriceon[/eluser]
Still doesn`t work :| I`ve trying both examples and nothing.. same 404
#18

[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';
#19

[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.
#20

[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




Theme © iAndrew 2016 - Forum software by © MyBB