CodeIgniter Forums
Pretty root urls - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Pretty root urls (/showthread.php?tid=19195)



Pretty root urls - El Forum - 05-31-2009

[eluser]Unknown[/eluser]
Hi there!

I'm pretty new to CodeIgniter and i'm trying to make my first CMS on it.

So, let's get to the point:

I have table named "static_pages" that contains id, url, body. So the idea is to make my main pages looks like: http://example.com/url. So for me the tricky part is to make my function in the Static Controller, which is set to "default_controller", called view to do this. Is this possible, or i should use mod_rewrite to rewrite example.com/view/url to example.com/url? If i do it with mod_rewrite i think that there will be some problems with the other Controllers, or i'm wrong?

Sorry for my bad English, i'm still learning it.

Thanks in advance!


Pretty root urls - El Forum - 05-31-2009

[eluser]Dam1an[/eluser]
<cough>RTFM</cough> Tongue


Pretty root urls - El Forum - 05-31-2009

[eluser]Unknown[/eluser]
Ok, i'm tryin' with this one:

$route[':any'] = "static_page/view/$1";

But the other controllers are not working.... Sad

Any ideas?

P.S.

Also

$route['(.*)'] = "static_page/view/$1"; is not working fine for me.