簡體   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