httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt <mattli...@spam.matt.blissett.me.uk>
Subject [users@httpd] Multiviews + PHP --> 406 for MSNbot, Googlebot. Content-type for .php files not appropriate to their content.
Date Sun, 15 Aug 2004 21:48:58 GMT
Hi

I'm using Multiviews with my URLs. Most of the files are PHP scripts  
returning text/html, though not all. The Content-Type header is set within  
the PHP using this:
  header("Content-Type: text/html; charset=utf-8");

MSNbot and GoogleBot receive 406 responses: for the URL  
http://matt.blissett.me.uk/contact for example, from a log (with the  
Accept header shown):
"GET /contact HTTP/1.0" "text/html" 406 "msnbot/0.11  
(+http://search.msn.com/msnbot.htm)"
"GET /contact HTTP/1.0" "text/html,text/plain" 406 "Googlebot/2.1  
(+http://www.google.com/bot.html)"

This is apparently the problem:

HEAD /contact HTTP/1.1
Host: matt.blissett.me.uk
Accept: text/html

HTTP/1.1 406 Not Acceptable
Date: Sun, 15 Aug 2004 21:33:06 GMT
Server: Apache/2.0.50 (Unix) PHP/4.3.8-dev
Alternates: {"contact.php" 1 {type application/x-httpd-php} {length 1388}}
Vary: negotiate
TCN: list
Content-Type: text/html; charset=iso-8859-1

Apache sees the contact.php file and 'knows' it is  
application/x-httpd-php. But in fact it returns (in this case) text/html.  
How do I tell Apache this?

Here's a few lines from the config file:

<Directory /home/*/public_html>
     AllowOverride None
     Options MultiViews Indexes SymLinksIfOwnerMatch Includes
</Directory>

DirectoryIndex index.html index.php index.html.var index.cgi index

TypesConfig conf/mime.types

DefaultType application/octet-stream

<IfModule mod_mime_magic.c>
     MIMEMagicFile conf/magic
</IfModule>

There are a couple of other problems, but these are most likely directly  
related anyway.

Thanks everyone :)

-- 
Matt
http://matt.blissett.me.uk/

---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message