The following makes the list of extensions capable of executing PHP:
AddType application/x-httpd-php5 .php .php5
How do I allow only one specific file to be able to run PHP?
The following does not work:
AddType application/x-httpd-php5 example.php9
2
Answers
You should use rewrite rule in htaccess.
You can not add filename to
AddType
directive. Only file extensions are allowed. To add php handler to a single file you can use this :Or
<filesMatch>
Reference :
Mod-rewrite flags
https://httpd.apache.org/docs/2.4/rewrite/flags.html#flag_h
filesMatch
https://httpd.apache.org/docs/2.4/mod/core.html#filesmatch