I am working on Codeingiter and have a Function in one of my class.
class Search extends My_Controller{
public function index(){
//my search code here...
}
}
Now for this function i need set a route so i can make the URL look like
http://example.com/s/?q=searchtext
or
http://example.com/s/#q=searchtext
However when i do this :
$route['s/?q=(:any)'] = "search/index";
$route['s/#q=(:any)'] = "search/index";
It does not work and i am being redirected to 404 page.
It seems CI does not allow this kind of Routing. Please tell me how i can do this.
Also If i use http://example.com/s/#q=searchtext
how can i get the value searchtext in my function ?