Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9129317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:43:05+00:00 2026-06-17T07:43:05+00:00

I have a symfony 2.1 project using FOSUserBundle. The bundle is installed correctly. All

  • 0

I have a symfony 2.1 project using FOSUserBundle. The bundle is installed correctly. All the functionalities work properly using the default /login form.

But now I want to change the login form route to be the same as the homepage (path: /).

I tried:

changing the security.yml – login_path:

firewalls:
    main:
        pattern: ^/
        form_login:
            provider: fos_userbundle
            csrf_provider: form.csrf_provider
            login_path: /
        logout:       true
        anonymous:    true

and the access_control to:

access_control:
    - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/admin/, role: ROLE_ADMIN }        
    - { path: ^/*, role: ROLE_USER }
    - { path: ^/, role: IS_AUTHENTICATED_ANONYMOUSLY }

When I try to access the homepage it enters a infinite redirect (I assume)

The page isn’t redirecting properly Firefox has detected that the
server is redirecting the request for this address in a way that will
never complete.

Also couldn’t find anything to troubleshoot this behaviour inside the FOSUserBundle documentation.

In short words: I want the first_page to act as login page.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:43:06+00:00Added an answer on June 17, 2026 at 7:43 am

    You have a redirect loop.

    access_control:
    - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }    #1
    - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }  #2
    - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY } #3
    - { path: ^/admin/, role: ROLE_ADMIN }                      #4
    - { path: ^/*, role: ROLE_USER }                            #5
    - { path: ^/, role: IS_AUTHENTICATED_ANONYMOUSLY }          #6
    

    This happens because first, you are telling access controll in #5 requires ROLE_USER BEFORE you tell it that it also requires IS_AUTHENTICATED_ANONYMOUSLY (both 5th and 6th rules match)

    Access control is order sensitive, the rules apply in the order they are defined, try:

    access_control:
    - { path: ^/$, role: IS_AUTHENTICATED_ANONYMOUSLY } # NOTE THE $
    - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/admin/, role: ROLE_ADMIN }        
    - { path: ^/*, role: ROLE_USER }
    

    I moved the rule

    - { path: ^/, role: IS_AUTHENTICATED_ANONYMOUSLY }
    

    to the begining so it matches before

    - { path: ^/*, role: ROLE_USER }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a many-to-many relationship defined in my Symfony (using doctrine) project between Orders
I have a project created using Symfony 1.4.15. Because I like Doctrine :) I
On a Symfony exploration project, I have a model using doctrine NestedSet behaviour. Since
I have a problem on a symfony 1.1 project with propel 1.3. I'm using
i am working on web Payroll project using symfony framework. we have 27000 employees
I have this wild project happening at work, and we happen to use Symfony
i am using Symfony 1.4, to create my project. i have tried to deploy
I have a project with symfony 2 and im using a SonataAdminBundle for my
I'm developing a project using Symfony 2.1. I have created a service that is
We have a Symfony 1.4 project and are looking to force HTTPS for all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.