Welcome Guest, Not a member yet? Register   Sign In
Routing to specific controller in case controller/method is not found.
#1

Hello there,

I'm trying to archieve to create custom url for specific content.

For example, i have blog and page tables in my database.

URL structure for the blog posts is "example.com/blog/view/post-slug-here" and it's working as intended.

Exclusively for page content, i want to create a URL structure like "example.com/page-slug-here".

Since this route taking priority over all rules:
PHP Code:
$route['(:any)'] = 'page/view/$1'
I couldn't managed to archieve it so far.

In fact, i can archieve this this 404_override. But i have doubt that i'll have trouble when things getting complex.

For example, when i need to create sub site as follows:
Code:
"example.com/sub-site"
"example.com/sub-site/blog/view/post-slug-here"
"example.com/sub-site/controller/method"

Probably i need to route sub-site's "example.com/sub-site/page-slug-here" to a controller other than 404_override.

What is the best way to archieve this?
Reply


Messages In This Thread
Routing to specific controller in case controller/method is not found. - by W140 - 09-25-2015, 09:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB