Symfony 2.8: No funcionan las rutas tras el despliegue en prod

100 visitas 0 respuestas

Saludos a todo el foro. He terminado un proyecto para probar symfony y al pasarlo a un servidor (del que tengo la gestión) no me funcionan las rutas correctamente, Accedo al raiz, por ejemplo: www.ejemplo.com, pero no a por ejemplo www.ejemplo.com/login

¿Qué se me ha pasado? Muchas gracias de antemano por vuestro interés.

Ya he comprobado app.php:

<?php

use Symfony\Component\HttpFoundation\Request;

/** @var \Composer\Autoload\ClassLoader $loader */
$loader = require __DIR__.'/../app/autoload.php';
//include_once __DIR__.'/../var/bootstrap.php.cache';

$kernel = new AppKernel('prod', true);
$kernel->loadClassCache();
//$kernel = new AppCache($kernel);

// When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter
Request::enableHttpMethodParameterOverride();
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
?>``` 
Y testeado rutas
``` # php bin/console debug:router 
_wdt                       ANY          ANY      ANY    /_wdt/{token}                      
  _profiler_home             ANY          ANY      ANY    /_profiler/                        
  _profiler_search           ANY          ANY      ANY    /_profiler/search                  
  _profiler_search_bar       ANY          ANY      ANY    /_profiler/search_bar              
  _profiler_info             ANY          ANY      ANY    /_profiler/info/{about}            
  _profiler_phpinfo          ANY          ANY      ANY    /_profiler/phpinfo                 
  _profiler_search_results   ANY          ANY      ANY    /_profiler/{token}/search/results  
  _profiler_open_file        ANY          ANY      ANY    /_profiler/open                    
  _profiler                  ANY          ANY      ANY    /_profiler/{token}                 
  _profiler_router           ANY          ANY      ANY    /_profiler/{token}/router          
  _profiler_exception        ANY          ANY      ANY    /_profiler/{token}/exception       
  _profiler_exception_css    ANY          ANY      ANY    /_profiler/{token}/exception.css   
  _twig_error_test           ANY          ANY      ANY    /_error/{code}.{_format}           
  contact                    GET|POST     ANY      ANY    /contact/{shelter}/{pet}           
  updateContent              GET|POST     ANY      ANY    /extranet/updateContent/{id}       
  addContent                 GET|POST     ANY      ANY    /extranet/addContent               
  delContent                 GET|DELETE   ANY      ANY    /extranet/delContent/{id}          
  uploadImage                POST         ANY      ANY    /extranet/uploadImage              
  uploadFile                 POST         ANY      ANY    /extranet/uploadFile               
  searchRelated              GET          ANY      ANY    /extranet/searchRelated/{search}   
  frontPage                  ANY          ANY      ANY    /                                  
  showSearchResult           POST         ANY      ANY    /search                            
  showTownPets               ANY          ANY      ANY    /town/{town}                       
  showShelterPets            ANY          ANY      ANY    /shelter/{id}/{shelter}            
  showPet                    ANY          ANY      ANY    /pet/{id}/{slug}                   
  showNews                   ANY          ANY      ANY    /news/{id}/{slug}                  
  downloadfile               GET          ANY      ANY    /download?file={file}              
  searchPet                  GET          ANY      ANY    /extranet/searchPet/{search}       
  updatePet                  GET|POST     ANY      ANY    /extranet/updatePet/{id}           
  addPet                     GET|POST     ANY      ANY    /extranet/addPet                   
  delPet                     GET|DELETE   ANY      ANY    /extranet/delPet/{id}              
  login                      ANY          ANY      ANY    /login                             
  login_check                ANY          ANY      ANY    /login_check                       
  logout                     ANY          ANY      ANY    /logout                            
  searchTown                 GET          ANY      ANY    /searchTown                        
  searchShelter              GET          ANY      ANY    /searchShelter/{town}              
  searchUser                 GET          ANY      ANY    /extranet/searchUser/{search}      
  updateUser                 GET|POST     ANY      ANY    /extranet/updateUser/{id}          
  addUser                    GET|POST     ANY      ANY    /extranet/addUser                  
  delUser                    GET|DELETE   ANY      ANY    /extranet/delUser/{id}             
  pwdUser                    GET|POST     ANY      ANY    /extranet/pwdUser/{id}             
  fos_js_routing_js          ANY          ANY      ANY    /js/routing.{_format}              
 -------------------------- ------------ -------- ------ -----------------------------------  ```
php bin/console debug:router login

+--------------+---------------------------------------------------------+ | Property | Value | +--------------+---------------------------------------------------------+ | Route Name | login | | Path | /login | | Path Regex | #^/login$#s | | Host | ANY | | Host Regex | | | Scheme | ANY | | Method | ANY | | Requirements | NO CUSTOM | | Class | Symfony\Component\Routing\Route | | Defaults | _controller: AppBundle:Security:login | | Options | compiler_class: Symfony\Component\Routing\RouteCompiler | | | expose: true | +--------------+---------------------------------------------------------+

y
php bin/console router:match /login

[OK] Route "login" matches

+--------------+---------------------------------------------------------+ | Property | Value | +--------------+---------------------------------------------------------+ | Route Name | login | | Path | /login | | Path Regex | #^/login$#s | | Host | ANY | | Host Regex | | | Scheme | ANY | | Method | ANY | | Requirements | NO CUSTOM | | Class | Symfony\Component\Routing\Route | | Defaults | _controller: AppBundle:Security:login | | Options | compiler_class: Symfony\Component\Routing\RouteCompiler | | | expose: true | +--------------+---------------------------------------------------------+


Respuestas

No existen respuestas para este tema