Welcome Guest, Not a member yet? Register   Sign In
Another URL question
#1

[eluser]wintercounter[/eluser]
Sorry folks, i've tried to search the Forum and the Docs, there's probably an answer in the forum to my question, but I even don't know how to search for...

How can i make dynamic segment 1?
Like Wordpress does...
For ex: mysite.com/codeigniter2.0_has_been_relased
Instead of: mysite.com/entry/codeigniter2.0_has_been_relased

Of course, if there's no match, than it should search for other controllers like contact, about_us, etc...

Thanks for your help!
#2

[eluser]stuffradio[/eluser]
You will want to use routes.

Code:
$route['defaultcontroller/(:any}'] = 'defaultcontroller/index/$1';
You can change the name of defaultcontroller to your default controller, and index to any function in that controller you want to.
#3

[eluser]wintercounter[/eluser]
Now i have this in the routes file:
Code:
$route['default_controller'] = "front";
$route['default_controller/(:any)'] = 'entry/index/$1';

But this only returns the 404 page:
mysite.com/something
#4

[eluser]wintercounter[/eluser]
Ok, now figured out, using this way now :

Code:
$route['default_controller'] = "front";
$route['(:any)'] = 'entry/index/$1';
$route['login'] = 'login';

But isn't there any other way, to not route all may URIs and pages?
Should I use a mod_rewrite based solution?




Theme © iAndrew 2016 - Forum software by © MyBB