2016-10-27 4 views
0

せずにルートを発見したことはできません。はapp_dev.php

しかし、私は

example.com/api/route/option 

のような別のルートへ行くしようとしたとき、私は正常に動作している

example.com/app_dev.php/api/route/option 

に行くとき、私はしかし、エラー404を得ました。

は、これは私の.htaccess

<IfModule mod_rewrite.c> 
    Options +FollowSymlinks 
    RewriteEngine On 

    RewriteRule ^app_dev.php - [L] 
    RewriteRule ^app.php - [L] 

    RewriteCond %{REQUEST_FILENAME} !-f 

    #RewriteRule ^(.*)$ app.php [QSA,L] 
    RewriteRule ^(.*)$ app_dev.php [QSA,L] 
</IfModule> 

であり、これはアイデアを得た

<VirtualHost *:80> 
    ServerName example.com 
    ServerAdmin my_mail 
    DocumentRoot /var/www/html/example/web/ 
     DirectoryIndex app_dev.php 
     <Directory /> 
       Options FollowSymLinks 
       AllowOverride All 
     </Directory> 
     <Directory /var/www/> 
       Options Indexes FollowSymLinks MultiViews 
       AllowOverride All 
       Order allow,deny 
       allow from all 
     </Directory> 

     ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ 
     <Directory "/usr/lib/cgi-bin"> 
       AllowOverride All 
       Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch 
       Order allow,deny 
       Allow from all 
     </Directory> 

     ErrorLog ${APACHE_LOG_DIR}/error.log 

     # Possible values include: debug, info, notice, warn, error, crit, 
     # alert, emerg. 
     LogLevel warn 

     CustomLog ${APACHE_LOG_DIR}/access.log combined 
</VirtualHost> 

私のバーチャルホストのですか?

ありがとうございます!

+0

あなたはhttp://symfony.com/doc/current/見てきましたsetup/web_server_configuration.html?あなたはあなたのウェブフォルダのために有効にされたオーバーライドを持っていないようです... – Chausser

答えて

1

あなたの仮想ホストファイルは、あなたの.htaccessファイルが読み込まれていないことを意味する上書きを有効にしません。仮想ホストのファイルにこれを追加してみてください:

<Directory /var/www/html/example/web/> 
    AllowOverride None 
    Order Allow,Deny 
    Allow from All 
</Directory> 

ます。また、ここに記載されているように、他のセットアップオプションを検討することもできます。http://symfony.com/doc/current/setup/web_server_configuration.html

関連する問題