我正在安装一个 symfony2 应用程序 packagist,但遇到了无法将 webroot 设置为“web”目录的情况。因为我不想输入 /web/ 或 /web/app.php,所以我需要一个 .htaccess 来适应这种情况,包括它转储到 p 子目录中的 json 文件。
问问题
105 次
1 回答
0
这是我使用的 .htaccess。
``` 选项 +FollowSymlinks RewriteEngine On
# Explicitly disable rewriting for front controllers
RewriteRule ^/web/app_dev.php - [L]
RewriteRule ^/web/app.php - [L]
# Fix the bundles folder
RewriteRule ^bundles/(.*)$ /web/bundles/$1 [QSA,L]
RewriteRule ^p/(.*)$ /web/p/$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
# Change below before deploying to production
RewriteRule ^(.*)$ /web/app.php [QSA,L]
#RewriteRule ^(.*)$ /web/app_dev.php [QSA,L]
```
于 2014-02-28T08:11:27.927 回答