In my web app, I need to redirect all URLs to a specific page, with the exception of 3 specific URLs.
How can I do it globally (and painlessly) in Yii Framework? Is there a base controller I can use to handle all GET requests?
I'm using Yii 2.0.
I would use this or similar UrlManager configuration:
'urlManager' => [ 'enablePrettyUrl' => true, 'rules' => [ // your rule for specific URL #1, // your rule for specific URL #2, // your rule for specific URL #3, '<controler>/<action>' => 'redirect/target', ], ]
This way everything that is not matched by first 3 rules is matched by the last one and goes to