R
R
Rajab Magomedov2021-10-09 19:18:23
Yii
Rajab Magomedov, 2021-10-09 19:18:23

How to set 404 page when rules are written in urlManager?

Hello, friends.
I use the yii2 basic framework , there is a rule in ' rules ': accordingly, when going to a non-existent page, it shows an error 500 , not 404 , because it tries to find an action according to the rule that was set above. How to fix this problem?

'<action:\w+>' => 'site/<action>'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Timur, 2021-10-10
@radhab20

You need to use ErrorAction https://www.yiiframework.com/doc/api/2.0/yii-web-e...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question