문제

I was installing packagist, a symfony2 app, and ran into a situation where I couldn't set the webroot as the 'web' directory. Because I didn't want to have to type /web/ or /web/app.php, I needed an .htaccess to accomodate this situation, including the json files it dumps in the p subdirectory.

도움이 되었습니까?

해결책

This is the .htaccess I used.

``` Options +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]

```

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top