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

前端 未结 7 1127
误落风尘
误落风尘 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:48

    You would need .htaccess file in parent folder of web, however, I wouldn't suggest doing so. That folder, apart from web, contains complete source, binaries, vendors and much more therefore you would need to apply many rules just to allow web-access to web folder and disallow web-access to everything else.

    So, it's doable, but I would definitely go for vhost solution...

提交回复
热议问题