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 7900125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:53:23+00:00 2026-06-03T08:53:23+00:00

I’ve got a big problem with routing: all pages matches with the same route!!

  • 0

I’ve got a big problem with routing: all pages matches with the same route!!

routing.yml

# default rules
homepage:
  url:   /
  param: { module: home, action: index }

# generic rules
# please, remove them by adding more specific rules

localized_homepage:
  url:   /:sf_culture/
  param: { module: home, action: index }
  requirements:
    sf_culture: (?:it|en|es|fr)

change_language:
  url:   /change_language
  param: { module: language, action: changeLanguage }

contatti:
  url:   /:sf_culture/:contatti.html
  param: { module: contatti, action: index }
  requirements:
    sf_culture: (?:it|en|es|fr)

about:
  url:   /:sf_culture/:about.html
  param: { module: about, action: index }
  requirements:
    sf_culture: (?:it|en|es|fr)

opera_slug:
  url:   /:sf_culture/opere/:operaslug.html
  class:    sfDoctrineRoute
  param: { module: opera, action: permalink }
  options:  { model: Opera, type: object }
  requirements:
    sf_culture: (?:it|en|es|fr)

opere:
  url:   /:sf_culture/:opere.html
  param: { module: opera, action: index }
  requirements:
    sf_culture: (?:it|en|es|fr)


default_index:
  url:   /:module
  param: { action: index }

default:
  url:   /:module/:action/*

_header.php

<ul>
<li><?php echo link_to(__('Home'), '@homepage') ?></li>
<li><?php echo link_to(__('About'), '@about?about='.strtolower(__('About'))) ?></li>
<li><?php echo link_to(__('Works'), '@opere?opere='.strtolower(__('Works'))) ?></li>
<li><?php echo link_to(__('Contacts'), '@contatti?contatti='.strtolower(__('Contacts'))) ?></li>
</ul>

When I click on a button on my menu (_header), I’m always redirected to contacts page, and watching log, I can see

Match route "contatti" (/:sf_culture/:contatti.html) for /es/obras.html with parameters array ( 'module' => 'contatti', 'action' => 'index', 'sf_culture' => 'es', 'contatti' => 'obras',) 

how is it possible? I’ve used @route sintax, so I tell symfony to use a particular route, but this is ignored.

do you have any idea on how to solve it?

Thanks a lot

  • 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-03T08:53:24+00:00Added an answer on June 3, 2026 at 8:53 am

    Symfony matches routes from top to bottom so the first route that symfony finds a match for gets executed.

    Your route is correctly expanded in your template but when the request is made symfony matches /es/obras.html correctly to the @contatti route. This happens because “obras” matches the “:contatti” parameter.

    To solve your problem you need to give symfony a way to uniquely match your urls.

    Hope this makes more sense to you now.

    Edit (unique routes):

    contatti:
      url:   /:sf_culture/contact/:contatti.html
      param: { module: contatti, action: index }
      requirements:
        sf_culture: (?:it|en|es|fr)
    
    about:
      url:   /:sf_culture/about/:about.html
      param: { module: about, action: index }
      requirements:
        sf_culture: (?:it|en|es|fr)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
i got an object with contents of html markup in it, for example: string
I am currently running into a problem where an element is coming back from
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

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.