K
K
kapai692015-02-16 16:31:25
symfony
kapai69, 2015-02-16 16:31:25

How to throw 404 status from access control?

There is a limit on ip

# security.yml
...
    access_control:
        - { path: ^/admin, roles: ROLE_ADMIN, ips: [127.0.0.1]}
        - { path: ^/admin, roles: ROLE_NO_ACCESS }

Accordingly, a 403 error is thrown on the server, is it possible to throw a 404 error?
As if there is no such page at all.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis, 2015-03-03
@prototype_denis

Hang listener on kernel.exception and change response
Documentation here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question