.htaccess for packagist,你不能选择web作为webroot



我正在安装symfony2应用程序packagist,遇到了无法将webroot设置为"web"目录的情况。因为我不想输入/web/或/web/app.php,所以我需要一个 .htaccess 来适应这种情况,包括它在 p 子目录中转储的 json 文件。

这是我

使用的.htaccess。

'

'' 选项 +关注符号链接 重写引擎打开

# 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]

```

最新更新