0

symfony2 アプリである packagist をインストールしていて、webroot を「web」ディレクトリとして設定できない状況に遭遇しました。/web/ や /web/app.php と入力する必要がなかったので、p サブディレクトリにダンプする json ファイルを含め、この状況に対応するために .htaccess が必要でした。

4

1 に答える 1

0

これは私が使用した .htaccess です。

``` オプション +FollowSymlinks RewriteEngine オン

# 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 に答える