Take the 2-minute tour ×

With this configuration:

        pattern:  ^/login$
        anonymous:  ~
        security: false

        pattern:   ^/foo$
        anonymous: ~
        security: false

        pattern:    ^/
            login_path: /login
            check_path: /login_check
            path:   /logout
            target: /

    - { path: ^/, roles: ROLE_ADMIN }
    - { path: ^/foo, roles: IS_AUTHENTICATED_ANONYMOUSLY }

I want to be able to make /foo anonymously accessible. However, when I try to go there even after clearing the cache it won't allow me to and redirects to login screen.

How do I make one route to be anonymously accessible while retaining the rest of the system to be secured?

share|improve this question

1 Answer 1

up vote 5 down vote accepted


- { path: ^/foo, roles: IS_ANONYMOUS }


- { path: ^/foo, roles: IS_AUTHENTICATED_ANONYMOUSLY }


Also, I believe, you will have to add

- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }

for authentication to work properly.

For more info check out Avoid Common Pitfalls section here.

share|improve this answer
Ok question update and I tried it, but it still redirects to login (I did clear the cache as well). –  Tower Feb 27 '12 at 9:15
Okay looked liked it just did not work for dev environment for some reason. –  Tower Feb 27 '12 at 9:18
@rFactor, it's hard to tell what's wrong now. Try to find clue in logs. –  Molecular Man Feb 27 '12 at 9:30
I'm having the same issue, my firewall won't allow anonymous on the one route in dev - the problem is we are only planning on using that route in dev. Did you figure out what was causing it? –  Jessica Oct 9 '13 at 15:04
@Jessica did you try to switch the order of the access_control rules? –  dlondero Oct 15 '13 at 8:21

Your Answer


