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]


Comments are closed.