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

前端 未结 7 970
误落风尘
误落风尘 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 08:04

    
        DocumentRoot "path_to_symfonyTest/web"  
        ServerName "symfonyTest"  
        
            DirectoryIndex app_dev.php
            AllowOverride All
            Order allow,deny
            Allow from all
            RewriteEngine On
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^(.*)$ app_dev.php [QSA,L]
            RedirectMatch permanent ^/app_dev\.php/(.*) /$1
        
    
    

    That's part of my httpd.conf

提交回复
热议问题