How to have files without extensions processed as php in Apache

When browsing directories in Apache, I would like to have files that do not have an extension that the server will process as php when clicking on them (those files containing php code).

+4
source share
1 answer

You can use the H flag in apach mode to force all files to be processed without the extension that is processed by the php handler:

try the following in htaccess:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !\. - [H=application/x-httpd-php]

on some servers you need to change httpd-php to httpd-php5:

RewriteRule !\. - [H=application/x-httpd-php5]
+5
source

Source: https://habr.com/ru/post/1617569/


All Articles