1
votes

I'm getting a lot of errors because of sf_culture = 1 on the server.

{sfConfigurationException} Unable to find a matching route to generate url 
for params "array (  'action' => 'legend',  'module' => 'housing',  'sf_culture' =>'1',)"

Locally this matches the default route:

Match route "default" (/:sf_culture/:module/:action/*) for /de_DE/housing/legend with 
parameters array (  'module' => 'housing',  'action' => 'legend',  'sf_format' => 'html',  
'sf_culture' => 'de_DE',)

wich looks like this

default:
  url:   /:sf_culture/:module/:action/*
  param: { sf_format: html }
  requirements:
    sf_culture: (?:<?php echo $cultures ?>)

Why is it even possible that :sf_culture or $sf_user->getCulture() is returning '1', also I have seen 'de?keepthis=true' in the logs which is even more strange.

What can I do about this error?

EDIT: I can't be the only one with this error? I mean just look at these logs (~ 1 Minute)

May 10 09:50:23 symfony [err] {sfConfigurationException} Unable to find a matching route to generate url for params "array (  'action' => 'legend',  'module' => 'housing',  'sf_culture' => 'en“',)".
May 10 09:50:34 symfony [err] {sfConfigurationException} Unable to find a matching route to generate url for params "array (  'action' => 'legend',  'module' => 'housing',  'sf_culture' => 'mvcleltja',)".
May 10 09:50:45 symfony [err] {sfConfigurationException} Unable to find a matching route to generate url for params "array (  'action' => 'legend',  'module' => 'housing',  'sf_culture' => '√ en',)".
May 10 09:51:26 symfony [err] {sfConfigurationException} Unable to find a matching route to generate url for params "array (  'action' => 'legend',  'module' => 'housing',  'sf_culture' => '1',)".
May 10 09:51:42 symfony [err] {sfConfigurationException} Unable to find a matching route to generate url for params "array (  'action' => 'legend',  'module' => 'housing',  'sf_culture' => 'whwgopshwhyrydi',)".
1
What containts your $cultures ? And by the way, did you check ips that generate these errors? Maybe it's a crazy bot trying lots of differents urls ..j0k
I'm stupid, it is always the same IP, seems like a Google bot.Rene Koller

1 Answers

0
votes

You can restrict the allowed cultures in your URLs via the routing.yml (apps/appname/config/routing.yml) like so:

localized_homepage:
  url: /:sf_culture/
  param: { module: yourmodule, action: youraction }
  requirements:
    sf_culture: (?:fr|en)