简体   繁体   English

使用.htaccess从Symfony2的URL中删除web / app.php

[英]Remove web/app.php from the url in Symfony2 using .htaccess

I have some shared ftp location on which I am trying to use the Symfony2 Framework. 我有一些共享的ftp位置,正在尝试使用Symfony2框架。

http://XYZ.com/ABC/Symfony http://XYZ.com/ABC/Symfony

And All i have is the ftp details and the database. 我所拥有的只是ftp详细信息和数据库。

Please help me to remove web/app.php form the url and that redirects to the main url. 请帮助我从网址中删除web / app.php ,并将其重定向到主网址。

put this in your .htaccess file inside your web/ directory: 将其放在您的web /目录下的.htaccess文件中:

<IfModule mod_rewrite.c>
    Options +FollowSymlinks
    RewriteEngine On

    # Explicitly disable rewriting for front controllers
    RewriteRule ^app_dev.php - [L]
    RewriteRule ^app.php - [L]

    RewriteCond %{REQUEST_FILENAME} !-f

    # Change below before deploying to production
    #RewriteRule ^(.*)$ app.php [QSA,L]
    RewriteRule ^(.*)$ app_dev.php [QSA,L]
</IfModule>

taken from here - symfony2 rewrite rules .htaccess app.php 取自此处-symfony2重写规则.htaccess app.php

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

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