2017-07-17 16 views
1

テスト用にWindowsマシンに新しいサイトをローカルに設定しています。文書のルートで、私がindex.htmlを持っていれば、問題なくブラウザに提供されます。名前をindex.phpに変更すると、ブラウザは何も受け取りません。サーバ側でエラーは発生しません。私はなぜそれを理解しようとしています。ここでのバーチャルホストApache 2.4:PHPファイルがブラウザに送信されていません。

<VirtualHost *:80> 
    DocumentRoot "C:\websites\learn" 
    ServerName learn.loc 

    LogLevel alert rewrite:trace2 

    #PHP SETTINGS 
    php_value auto_prepend_file "C:\websites\learn\noop.php" 
    php_value open_basedir "C:\websites\learn" 

    <Directory "C:\websites\learn">  
     Options Indexes FollowSymLinks 
     AllowOverride All 
     Require all granted 
    </Directory> 

</VirtualHost> 

は、ドキュメントルートに存在する.htaccessファイルです:

ここ
RewriteEngine on 
#point to javascript learning project 
RewriteRule ^js /javascript 
RewriteRule ^js/(.*) /javascript/$1 

私はlearn.loc/javascriptをロードするときに生成mod_rewriteログです(このフォルダはindex.phpファイルを持っています)

[initial] [perdir C:/websites/learn/] pass through C:/websites/learn/javascript/ 
[subreq] [perdir C:/websites/learn/] pass through C:/websites/learn/javascript/index.html 
[subreq] [perdir C:/websites/learn/] pass through C:/websites/learn/javascript/index.htm 
[subreq] [perdir C:/websites/learn/] pass through C:/websites/learn/javascript/index.php 

ApacheまたはPHPエラーログには何も追加されません。ブラウザ自体は、以下の応答ヘッダ

Date:   "..." 
Server:   "Apache/2.4.16 (Win32) PHP/5.6.23" 
X-Powered-By: "PHP/5.6.23" 
Content-Length: "0" 
Keep-Alive:  "timeout=5, max=100" 
Connection:  "Keep-Alive" 
Content-Type: "text/html; charset=UTF-8" 

応答本体が空の文字列であると共に、status code 200を受信します。私が言ったように、ファイルの名前をindex.htmlに変更すると、内容(vanilla htmlファイル)が表示されます。何が起こっているのでしょうか?

答えて

関連する問題