Welcome Guest, Not a member yet? Register   Sign In
Best way to route dynamic / random urls without controller?
#1

[eluser]snoo[/eluser]
I have a little codeIgniter project that requires a dynamic routing of any 1 segment uri to a landing page.

mysite.com/aef23f9 will need to be routed to my landing controller. But all my regular controllers will need to be routed with default behavior.

What is the best way to do this?

I've tried to config my routing with
Code:
$route[(:any)] = 'landing/$1'
it essentially reroutes everything with 1 segment and ignores my controller.

Should I extend the CI_Router with my own request verification?

thanks guy.
#2

[eluser]Aken[/eluser]
Use the 404 controller to check the URL and process accordingly.
#3

[eluser]snoo[/eluser]
ah genius!

thanks! I'll do that.




Theme © iAndrew 2016 - Forum software by © MyBB