Answer the question
In order to leave comments, you need to log in
How to disable all unnecessary parameters in the url in Yii2, displaying 404?
Actually a subject. Suppose the user writes site.com/index.php?abc=123 instead of site.com/index.php and then there should be a 404 error. The default code is 200.
Answer the question
In order to leave comments, you need to log in
Yii:$app->request->get() - Returns GET parameter with a given name. If name isn't specified, returns an array of all GET parameters.
www.yiiframework.com/doc-2.0/yii-web-request.html#...
Accordingly, you can write a filter that will track all left parameters and issue a 404 error.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question