Best way to remove "content" from my url |
[eluser]tommo.wilson[/eluser]
Hi there, I have a CMS which I have built and currently the url's for a page look like this... http://www.example.com/content/example-page http://www.example.com/content/test-page What I would like is to have the pages look like this instead... http://www.example.com/example-page http://www.example.com/test-page How would I go about doing that? Cheers Tom
[eluser]DBPolito[/eluser]
I don't know if it is the best way, but some time i used this in config/routes.php: $route['^((?!controller_names|controller_names)\S*)'] = "controller/function/$1"; Replace controller_names by your controllers that you don't want redirect. Someone have another way? Regards
[eluser]portgaz[/eluser]
Hi I think you can use this one: Code: $route['content/(.*)'] = '$1';
[eluser]tommo.wilson[/eluser]
Hi DBPolito That works perfectly...not sure why because I'm not that hot at regular expressions. But thanks all the same. Tom |
Welcome Guest, Not a member yet? Register Sign In |