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ファイル)が表示されます。何が起こっているのでしょうか?