I have following URL rule in my configuration file:
'rules' => [
'http://<store_url:\w+>.example.com/<product_name:\w+>' => 'index/index'
]
I type http://mystore2.example.com/iphone-15 and I got 404 error. What am I doing wrong?
try this after the last slash \w+(-\w+)+
to match hyphenated words. It could be 'http://<store_url:\w+>.example.com/<product_name:\w+(-\w+)+>'
Let me know if it worked