Check if your symfony application is ready for deployment

Remove "/backend.php/" from your uri
  • design

In the apps/frontend/config/settings.yml file, you can delete the application name from your uri by activing the no_script_name option.

This option is enabled for the first generated application (most often, the frontend), but not for the others.

Why ?

Because without the application name, symfony wouldn't know which one to use when the applications share the same domain.

We have to find an other way to let symfony know which application to use.

A solution can be to use several domains :

  • for the frontend
  • for the backend

Personnally, I prefer use some sub domains for each application :

  • for the frontend
  • for the backend

If your project is hosted on a dedicated server

You juste have to add a new virtual host in httpd.conf :

<VirtualHost *:80>
  DirectoryIndex backend.php
  DocumentRoot "/path/to/the/web/directory"
  <Directory "/path/to/the/web/directory">
    AllowOverride All
    Allow from All
  Alias /sf /path/to/the/symfony/data/web/sf
  <Directory "/path/to/the/symfony/data/web/sf">
    AllowOverride All
    Allow from All

If your project is hosted on a shared hosting environment

In that case, you probably can't access to the httpd.conf.
So let's play with the /web/.htaccess. Just after :

<IfModule mod_rewrite.c>
  RewriteEngine On

Add the following lines:

# The admin subdomain returns to the backend
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{HTTP_HOST} ^admin\.my-app\..*
RewriteRule ^(.*)$ backend.php [QSA,L]

Now, you can modify settings.yml

    no_script_name:  true

Don't forget to clear the cache.

php symfony cc