dongnunai3125 2016-01-30 18:51
浏览 64

Symfony 2删除了app.php

i have been through lots of topic about this, and the thing is still not working so i was wondering if you could help me to see what i am doing wrong.

My goal is to have neat URL as www.name.com without the app.php nor web, and i have changed over and over my Virtualhost & Htacces that my page are kind of gone for now^^ (Yeah so pro)

So first, i have enabled the rewrite mod, and i am running a 2.2.2 apache version.

Here is my VirtualHost files :

<VirtualHost *:80>
    ServerName steeph
    ServerAlias name.com

    DocumentRoot /home/ksc/www/symfony/web
    <Directory /home/ksc/www/symfony/web>
        AllowOverride All
        Order Allow,Deny
        Allow from all
    </Directory>

    ErrorLog /var/log/apache2/project_error.log
    CustomLog /var/log/apache2/project_access.log combined
</VirtualHost>

I have also tried with line on :

<Directory "path">
        DirectoryIndex app.php
        Options -Indexes
        AllowOverride All
        Allow from All
</Directory>

which are not working either

For my htaccess i have tried at the symfony files root (and removing the /web from the virtual host) which was a fail, and i tried with this htaccess

<IfModule mod_rewrite.c>
    RedirectMatch permanent ^/app\.php/(.*) /$1
    RewriteEngine On
    RewriteBase /web/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ app.php [QSA,L]
</IfModule>

I tried with the "RedirectMatch permanent ^/app.php/(.*) /$1" and without

So i have been to like a dozen of stackoverflows and i have tried even not popular answer but it still not working, so i would really appreciate some help here

Thanks a lot!

  • 写回答

2条回答 默认 最新

  • dongluanban3536 2016-01-31 04:16
    关注

    You could just copy the one from symfony standard edition

    -> https://github.com/symfony/symfony-standard/blob/master/web/.htaccess

    and it would just work fine.

    评论

报告相同问题?

悬赏问题

  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?