Forum Moderators: phranque
AddHandler php5-script .php
or
this line in http.conf:
AddType application/x-httpd-php .html
Both of these cause Apache to parse any file with those strings as PHP code. For instance, the file foo.php.anything or bar.html.anything are being parsed by the PHP engine. Under PHP4/Apache 2.0.52, these files would not be parsed as PHP.
I'm not really sure if this is a problem with my PHP or Apache config so I decided to post it here. Any help would be greatly appreciated.
Welcome to WebmasterWorld!
See Files with Multiple Extensions [httpd.apache.org], as it probably bears on the problem you're seeing.
Jim
What I don't understand is why this wasn't the case with PHP4. What exactly is the difference between AddHandler and AddType? From the docs, it seems that AddType tells Apache to send the file to a module whereas AddHandler sends it to a seperate process. This is really the only difference in how apache/php interact that I can see and they both should honor multiple file extensions the same.
Also, to continue with the noob questions, is it possible to use a regular expression for these directives to force Apache to only parse files that end in .php?
Again thanks for the help.