#28023 [Fbk->Opn]: Apache2: PHP installation method breaks content negotiation
| From: | mark at tranchant dot plus dot com | Date: | Sat, 18 Sep 2004 19:10:45 +0000 |
| Subject: | #28023 [Fbk->Opn]: Apache2: PHP installation method breaks content negotiation | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969364159@lists.php.net to get a copy of this message | ||
ID: 28023
User updated by: mark at tranchant dot plus dot com
Reported By: mark at tranchant dot plus dot com
-Status: Feedback
+Status: Open
Bug Type: Documentation problem
Operating System: Linux
-PHP Version: 4.3.5
+PHP Version: 4.3.5 / 5.0.1
New Comment:
Yes. The whole point of content negotiation is that the URLs do not
force the file type, but the Accept request header gives the server the
information it needs to choose an appropriate file type.
It also allows the author to switch technologies (e.g. static .html to
dynamic .php) without updating all the links and suffering from
out-of-date inbound links.
You're right - the problem only occurs if the request doesn't contain
.php, but that's not a workaround. The solution presented on my page is
a workaround, but it's not documented. Basically, the server admin needs
to use:
AddHandler php5-script php
AddType text/html php
instead of
AddType application/x-httpd-php .php
Then, when an extensionless request comes in with an Accept header
including text/html, the server knows that the .php file is an
appropriate type to send.
Previous Comments:
------------------------------------------------------------------------
[2004-09-18 11:01:00] vrana@php.net
This is in the Apache 2 documentation: "The effect of MultiViews is as
follows: if the server receives a request for /some/dir/foo, if
/some/dir has MultiViews enabled, and /some/dir/foo does not exist,
then the server reads the directory looking for files named foo.*". So
the only problem is if the request doesn't contain .php extension,
right?
------------------------------------------------------------------------
[2004-04-16 06:25:55] mark at tranchant dot plus dot com
Description:
------------
Please see http://tranchant.plus.com/notes/multiviews
which describes
the problem. Basically, the installation instructions break Apache's
MultiViews. The URL above also presents a solution, which relies on
largely undocumented features. I'd like these features documented to
prevent them disappearing in future versions.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=28023&edit=1