Re: test.html.php shown as html not as php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Jan 28, 2008 10:21 AM, Marten Lehmann <lehmann@xxxxxx> wrote:
> Hello,
>
> using apache 2.2.4 we have these lines in our httpd.conf (among others
> of course):
>
> AddType application/x-httpd-php .php
> AddHandler server-parsed .html
>
> This works generally fine: .php files are executed by the php
> interpreter and .html files processed by the SSI processor of apache.
>
> Today a user informed us, that naming a file e.g. test.html.php results
> in an unexpected behaviour:

There are two problems here:

1. Using AddType to activate the php HANDLER. You should be using
AddHandler for php as well. (Yes, this is incorrectly document in the
php manual and has been that way forever. The php people don't seem to
be too concerned about this issue which hits people who deal with
multiple-extensions.)

2. Understand that files can have multiple extensions and apache will
apply config directives for each extension.

Using AddHandler properly will fix the test.html.php case, since the
handler for the last extension (php) will take precedence over the
INCLUDES handler. The test.php.html will still not work. If you want
that to work, you need to RemoveHandler for the .html extension for
that file.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux