|Summary:||Nested file extensions, If file names include .php, the file will be run as x-httpd-php even if the true file extension is other (ex: .txt)|
|Product:||Apache httpd-2||Reporter:||Webhead <bridgemonkey>|
|Component:||Core||Assignee:||Apache HTTPD Bugs Mailing List <bugs>|
Description Webhead 2006-05-04 18:47:53 UTC
In Apache 2, php files with nested extensions such as .php.phps.txt or .phps.php.txt will run as a x-httpd-php. All other extensions are ignored even if the true file extension is .txt or .phps or even .pl. No matter where it's placed, if the .php is found in the file name, it is run as x-httpd-php. I tried moving the "AddType application/x-httpd-php .php" to the bottom of the list just for kicks, but it made no difference.
Comment 1 Ruediger Pluem 2006-05-04 20:50:09 UTC
Have you checked if this happens also with php files that you name somename.tst.txt and adding AddType application/x-httpd-php .tst to your configuration? No fingerpointing, but in most cases these kind of reports turn out to be php bugs.
Comment 2 William A. Rowe Jr. 2006-05-04 21:21:57 UTC
File name components have always been ordered (1st to last) with the last one replacing the mime control and filter control of the previous segment. 99% certain you are either setting AddHandler conditionally on file-type, which is problematic unless you also set AddHandler conditionally on every stock file type (e.g. .txt) replacing the original. Secondly, you can change the handler by the AddType application/x-httpd-php .php you mentioned which is good - if that's your only override. Please review and ensure you have AddType text/plain .txt to override the AddType application/x-httpd-php metadata! Make sure your httpd.conf file resolves mime.types Bill