Tara
Tara

Reputation: 1598

PHP Include Not Working on One Page

So, I finally got the PHP include function to work by tweaking the .htaccess file yesterday. The index shows up perfectly. But get this, I duplicate the index.html file, rename it and upload it as another page (as a template to work from) and now the PHP include function is not working on that page, even though it's exactly the same code hosted on the same server with the same .htaccess file.

The original file is also .html and the server is set up to interpret it properly, and does work in this way with another website which is on the same server.

.htaccess file:

ErrorDocument 404 /error-page.html
#
<FilesMatch "\.(gif|jpg|png)$">
ErrorDocument 404 /404.gif
</FilesMatch>

Options +MultiViews
AddType application/x-httpd-php .html

Any idea what's going on?

Upvotes: 0

Views: 475

Answers (1)

Homer6
Homer6

Reputation: 15159

Can you add this to your .htaccess?

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

My guess is that your .htaccess doesn't work and apache's configuration is handling it, but only for index files.

Upvotes: 1

Related Questions