Answer the question
In order to leave comments, you need to log in
How to keep only one available route format and set 302 redirect in others in Yii2?
There is a link of the format:
domain.com/catalog/items?slug=some-param - let's call it " Original "
Made it in the following format:
domain.com/catalog/items/some-param - let's call it " Beautiful "
Using the rule in UrlManager :
'catalog/items/<slug:[a-z0-9_\-]+>' => '/catalog/items',
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question