How to remove “web/app_dev.php” from Symfony2 URLs?

前端 未结 7 1124
误落风尘
误落风尘 2020-12-13 07:01

I just created my first Symfony2 project. But the \"/web/app_dev.php\" part in the URL annoys me. It should be possible to do this without Virtual hosts...

7条回答
  •  执笔经年
    2020-12-13 07:44

    1. //enable mod rewrite
      sudo a2enmod rewrite

    2. Change all occurrences of AllowOverride None by AllowOverride All
      File: (/etc/apache2/apache2.conf) or (/etc/apache2/sites-available/000-default.conf) - for me work with /etc/apache2/apache2.conf file.

    Example:

    
            # enable the .htaccess rewrites
            Options Indexes FollowSymLinks
            #AllowOverride None #commented
            AllowOverride All
            Require all granted
    
    
    1. //Restart apache service:
      sudo service apache2 restart

提交回复
热议问题