繁体   English   中英

htaccess symfony2重定向到Web目录

[英]htaccess symfony2 redirect to web directory

我刚刚发布了我的symfony proyect,但是URL是http://url.com/web/ 我想更改.htaccess指向web directory 因此,我希望它的网址像http://url.com/ 我试图更改我的.htaccess但未成功。

我的项目在共享主机中,我无法创建虚拟主机。 我在symfony根目录中使用了该.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>

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

请阅读该页面并查看Apache配置。

http://symfony.com/doc/current/setup/web_server_configuration.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM