Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Matching Two Similar Url's, Routing To Different Controller Functions

$
0
0
I am having some issues with the URL's, they are currently like this and working fine:

/blog/my-blog-post-example with the URL manager set to 'blog/<slug:[\w\-]+>' => 'blog/view',

However I need another work around so if the URL contains %20 instead of a - it goes to a different controller function which will 301 redirect to the correct URL. Is it possible to have the two entries in URLmanager to do this:

'blog/<slug:[\w\-]+>' => 'blog/view', - works perfect
'blog/WORK-AROUND' => 'blog/badurl',

Thanks in advance.

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>