CodeIgniter Forums

Full Version: Routing problem using $_GET query string
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

Hi, I need help on CI routing.

The situation is that I have to use $_GET, thus using a query string to transfer from one page to another. Now, my problem is how to route properly.

Here's my scenario ...

1. I have this '$route['^search/?$'], which redirects to 'folder1/controllerOne' .

This basically means that if something like 'search' or 'search/' is on the url, then it will redirect to folder1/controller1.

2. I need '$route[^search\?.*$']' to redirecto to another controller, say folder1/controller2.

This means that if I get something like '', then this sould be redirecting to controller2, since search is followed by '?'.

So, how do I do something like this on CI?

Thanks in advance