Welcome Guest, Not a member yet? Register   Sign In
route problem, when first segment unknown
#1

[eluser]Unknown[/eluser]
Hi,

I'd like to have the first segment of my URL to be unknown and the rest of the
URL is the URL to the controller. So let me explain you by the following code:
Code:
http://www.test.com/unknown/controller/function/
I need this, because in the first segment I want to check if a specific value is set in the database which is given in the first segment of the url.

What I want is something like on kicktipp.de, here you will find a demo betting community
Code:
http://www.kicktipp.de/demo/
if you write something different than demo, kicktipp checks if such a betting community is available, when not a error page will be shown.

for this I added following code to my routes config file
Code:
$route['([a-z]+)/(:any)'] = '$2';
but when I want to call the following url (a normal codeigniter call)
Code:
http://www.test.com/controller/function/
I always get the error, that the controller could not be found. I'm aware of the problem, because codeigniter try to call only following url
Code:
http://www.test.com/function/
where of course the controller cannot be found ...

So I'd like to know, if somebody has any idea of how to solve this problem?
I don't know what to do if the unknown part will be left blank and the controller will be called the correct (codeigniter) way?

Thanks for your help Wink




Theme © iAndrew 2016 - Forum software by © MyBB