Serve files with no extension as PHP

So I recently wget mirrored a whole website and uploaded them to my web server. The PHP files from the original server had no extension and when trying to load them, Apache did not serve them as PHP, loading a bunch of jibberish.

To solve this problem, I had to edit .htaccess :

< FilesMatch '^[^.]+$' >
ForceType application/x-httpd-php
< /FilesMatch >


#AddHandler server-parsed .php

#SetHandler application/x-httpd-php

#AddHandler application/x-httpd-php .php


#RewriteEngine On
#RewriteRule ^[^.]+$ – [T=application/x-httpd-php,L]

Popularity: 7% [?]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>