By using this link (http://www.yiiframework.com/doc-2.0/guide-runtime-routing.html#catchall-route) I tried to check some parameter for whole website, but I do not know how to get rid of it, for example after check some conditions I tried to use $this->redirect to going somewhere else but it stick in a loop that always call website entry action.
Start here and look for an extension point where you can inject your custom logic. EVENT_BEFORE_REQEST and EVENT_BEFORE_ACTION are both good candidates.