htaccess symfony2重定向到web目录

Jon*_*nez -1 .htaccess redirect symfony

我刚刚发布了我的symfony proyect,但网址是http://url.com/web/.我想改变我.htaccess的观点web directory.所以,我想要它的网址就像http://url.com/.我试图改变我,.htaccess但我没有成功.

小智 5

我的项目在共享主机中,我无法创建虚拟主机.我在symfony root中使用了这个.htaccess文件并且正常工作.

<IfModule mod_rewrite.c>
    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]

    # Fix the assets folder
    RewriteRule ^assets/(.*)$ /web/assets/$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]
</IfModule>
Run Code Online (Sandbox Code Playgroud)

https://undebugable.wordpress.com/2014/11/12/symfony2-htaccess-to-redirect-request-from-web-to/