I recently needed to set up a Symfony install without a separate virtual host, so as a subdirectory of the (Apache) DocumentRoot directory (like: http://www.example.com/symfony/).
As you may know, symfony appreciates it when it has a reserved virtual host for itself, but also provides ways to just install it in a separate directory. The following steps need to be taken:
1. Change the apps/<yourapp>/config/settings.yml file and set relative_url_root
2. Go to your front controller’s .htaccess file (usually in web/) and modify the RewriteBase directive
3. Optionally, if you want to omit the script name in production environment url’s, be sure to have enabled no_script_name = on in apps/<yourapp>/config/settings.yml
4. If you took step 3, be sure to check if your apache installation has support for mod_rewrite enabled.
This way you can have nice url’s, like http://www.example/subdir/module/action