I learn Symfony2 and i have: http://symfony.com/doc/current/quick_tour/the_big_picture.html


And if you use Apache with mod_rewrite enabled, you can even omit the app.php part of the URL:


Last but not least, on the production servers, you should point your web root directory to the web/ directory to secure your installation and have an even better looking URL:


how can i make this in WAMP Server?

marked as duplicate by MDMoore313, Hyppy, EEAA, dawud, Scott Pack Apr 18 '15 at 0:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

migrated from stackoverflow.com Nov 16 '11 at 0:26

This question came from our site for professional and enthusiast programmers.


What you want to do is add a virtual host which points to the symfony application. You can do that by adding another virtual host with the following configuration:

<VirtualHost *:80>
    ServerName localhost

    # Basic stuff
    DocumentRoot "C:/path/to/symfony/web"
    DirectoryIndex app.php
    <Directory "C:/path/to/symfony/web">
        AllowOverride All
        Allow from All

Depending on your configuration, you either have a httpd-vhosts.conf within your apache/conf/extra folder where you can add the part or you can add it to the httpd.conf! Make also sure no other virtual host for localhost is defined.

  • serverfault.com may not be the best place to ask question regards sf2 and since there isn't yet any efficient way to receive support with symfony 2 I think the following proposal is a very good idea! - A new Q&A site for symfony2 - Please join & spread the word! – Xuni Nov 20 '11 at 10:39

First you need to enable mod_rewrite in Xampp the way it says here. Then you need to set a mod_rewrite rule in the .htaccess of your application typically in the "web" folder. A rule to remove the app.php would be like this:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ app.php [QSA,L] 

If you want to know more about URL Rewriting here is a nice tutorial.

  • thanks, but this is default in Symfony. how can i remove Symfony/web ? – Martin Jenseb Nov 10 '11 at 18:13