拡張子無しでPHPを動作させる場合の記述例
.htaccess に以下の記述をすること。
そして拡張子無しで動作させたい PHPファイルがあるディレクトリに .htaccess を保存する。
DefaultType application/x-httpd-php
<files *.html>
ForceType text/html
</files>
<files *.css>
ForceType text/css
</files>
<files *.js>
ForceType text/javascript
</files>
<files *.gif>
ForceType image/gif
</files>
<files *.jpg>
ForceType image/jpeg
</files>
<files *.png>
ForceType image/png
</files>
Apache の エラーログ( error.log )で、
404 "/favicon.ico not found" が記録される場合、
以下の記述を .htaccess に追加する。
<files *.ico>
ForceType image/ico
</files>

コメントする