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. (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. “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:


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!