One route direction

I have such route rule
‘superurl’ => ‘site/url’
If I use site/url I want not replace it with superurl
But if I use superurl I want mapping it to site/url
How can I do it?

All you need is to adjust main.php in config folder. Adjust urlNamager[‘rules’]
at the end add line

That way if you type site/url you will follow default rule controller/action, but if superurl is explicitly typed it will go to site/url in backgound

1 Like