title: Problem with symfony multi language in sub directory
body: <p>when trying to access my symfony 5 production environment i get a problem with the redirection for the language. It redirect automaticaly to :
  mydomain.com/en
  instead of mydomain.com/subdirectory/en</p>
  <p>i tried to update the file config/packages/security.yaml</p>
  <pre><code> access_control:
   - { path: ^/subdirectory/(%app_locales%)/(register|login), roles: IS_AUTHENTICATED_ANONYMOUSLY }
   - { path: ^/subdirectory/(%app_locales%)/admin, roles: ROLE_USER }
  </code></pre>
  <p>I guess i've to specify elsewhere the auto detect language redirect but ican't found it</p>
  <p>My Symfony app is sharing a conf file with the wordpress frontend</p>
  <p>Directory are:</p>
  <pre><code>Wordpress: /home/mydomain/web/mydomain.com/public_html/wordpress-front/
  Symfony: /home/mydomain/web/mydomain.com/public_html/app/public
  </code></pre>
  <p>here is the nginx config file</p>
  <pre><code>upstream php {
          server unix:/tmp/php-cgi.socket;
          server 127.0.0.1:9003;
  }
  server {
      listen      xxx.xxx.xxx.xxx:443 ssl http2;
      server_name mydomain.com www.mydomain.com;
      ssl_certificate         /home/mydomain/conf/web/ssl.mydomain.com.crt;
      ssl_certificate_key     /home/mydomain/conf/web/ssl.mydomain.com.key;
      
      ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;
      ssl_ciphers         HIGH:!aNULL:!MD5;
  
      root        /home/mydomain/web/mydomain.com/public_html/wordpress-front/;
      index index.php index.php index.html;
      
      access_log  /home/mydomain/web/mydomain.com/logs/mydomain.com.access.log combined;
      access_log  /home/mydomain/web/mydomain.com/logs/mydomain.com.accesslog.bytes bytes;
      error_log   /home/mydomain/web/mydomain.com/logs/mydomain.com.error.log error;
  
      # restrict access to hidden files, just in case
      location ~ /\. {
          deny all;
      }
  
      set $symfonyRoot /home/mydomain/web/mydomain.com/public_html/app/public;
      set $symfonyScript index.php;
      set $subAlias mydomainapp;
      
      location /mydomainapp {
          root $symfonyRoot;
          rewrite ^mydomainapp(.*)$ /index.php/$1 break;
          try_files $uri @symfonyFront;
      }
  
      location / {
          try_files $uri $uri/ /index.php?$args;
      }
  
     
    # This is for the Symfony application
      location @symfonyFront {
          
          
          fastcgi_param APP_ENV prod;
          
          fastcgi_pass 127.0.0.1:9003;
          include /etc/nginx/fastcgi_params;
          
          fastcgi_param SCRIPT_FILENAME $symfonyRoot/$symfonyScript;
          fastcgi_param SCRIPT_NAME /$subAlias/$symfonyScript;
          fastcgi_param REQUEST_URI /$subAlias$uri?$args;
          
          fastcgi_index index.php;
      }
  
    # This is for the wordpress app
      location ~ \.php {
          fastcgi_pass 127.0.0.1:9003;
          fastcgi_index index.php;
          fastcgi_param PATH_INFO $fastcgi_path_info;
          fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
          fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
          fastcgi_param REQUEST_URI $uri?$args;
          include /etc/nginx/fastcgi_params;
      }
          location ~* &quot;/\.(htaccess|htpasswd)$&quot; {
          deny    all;
          return  404;
      }
      
      include     /home/mydomain/conf/web/nginx.mydomain.com.conf*;
  }
  </code></pre>