0

I would like to configure an Apache webserver 2.4.37 to hide the fact that it is serving PHP files.

For this, I renamed all .php files to .html and inserted the following directive:

AddType application/x-httpd-php .htm .html

as suggested here.

However, this does not work; all .html files are not passed through PHP. Any ideas?

The version of PHP installed is 7.2.24.

6
  • Stupid question... did you restart apache? I've just tried with apache 2.4.41 and it works. Commented Oct 20, 2020 at 17:30
  • @schrodigerscatcuriosity Yes, I did. Commented Oct 21, 2020 at 12:02
  • 1
    I've just tried with Apache/2.4.38 (Debian) changing the extension to .py and worked. Do you want I share the phpinfo? I don't know if it could be useful. PHP 7.3.14. Commented Oct 21, 2020 at 14:13
  • https://pastebin.ubuntu.com/p/XcFpsNs6mn/ Commented Oct 21, 2020 at 14:16
  • Can you please share the content of your Apache config file? I have a Let'sEncrypt SSL cert with a RewriteRule from HTTP to HTTPS on my config, and this perhaps interferes somehow. Commented Oct 21, 2020 at 14:38

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.