Site/index And User Friendly Urls

Hi guys,

Description. There is a products list on the main page (site/index). I’d like to make it searchable and paginated using user friendly URLs e.g. urlToSite.com/search/keyword/page/2 (note that search is parameter, not controller). In general - it’s one page web app

Problem. I have as issue with URL rules - cannot figure out how to pass parameters to site/index using user friendly URLs (e.g. urlToSite.com/search/keyword/page/2). “site/index” is hidden and parameters are treated as controller/action causing “Unable to resolve the request” error. I’ve tied many urlManager rules without success including this one:


'<search:\w+>'=>'site/index',

Any help would be appreciated :)

Thanks in advance

Hi Lagel, welcome to the forum.

Did you try this?




'' => 'site/index',



Or …




'search/<search:\w+>' => 'site/index',



Great, your second rule did a trick! Thank you very much!