How to properly load a symfony project on a hosting?

On LAN, when I turn on the development mode, everything works fine for me. But if I copy files to the hosting, then the routing does not work and you have to write links in the form of "site.com/web/app_dev.php/someroute", just as with development mode disabled on LAN. How to make that all work?

  • What kind of hosting? Does specifying redirection rules in .htaccess? What exactly happens after uploading to hosting? - Hast

2 answers 2

For those who can not configure the Symfony2 Framework, Symfony3:

  1. In the www folder, create .htaccess and write to it:

    RewriteEngine On RewriteCond %{REQUEST_URI} !^/web/.*$ RewriteRule ^(.*)$ /web/$1 [QSA,L] 
  2. In the web folder we find .htaccess (which comes with symfony) and comment on the line

     Options -MultiViews 
  3. After that, everything should work fine.

    Check with the hoster, you have Apache or nginx.

    Then follow the instructions:
    http://symfony.com/doc/current/cookbook/configuration/web_server_configuration.html