Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Web Server Configuration _ Content negotiating

Posted by: Dag Nov 23 2006, 03:55 PM

There are some script that validate web-pages. Used by few top Russian search web-sites. There, page 'index' is not acceptable (406) but page index.html is ok. Why so? Is it correct? How about content negotiating?

error 406 --
good one --

Basic question: is this script good or not? If yes, what should I do with this 406?

Thank in advance,


Posted by: Liam Quinn Nov 23 2006, 10:27 PM

The 406 error is something that you should correct. Right now, a browser that sends "Accept: text/html" gets a 406 error from :

$ curl --head -H 'Accept: text/html'
HTTP/1.1 406 Not Acceptable
Date: Fri, 24 Nov 2006 03:18:11 GMT
Server: Apache
Alternates: {"index.html" 1 {type application/x-httpd-php} {length 1753}}
Vary: negotiate
TCN: list
Content-Type: text/html; charset=iso-8859-1

It looks like your server thinks that index.html is application/x-httpd-php instead of text/html. You probably have a directive like this in your Apache configuration:

AddType application/x-httpd-php .html

You should replace that with

AddHandler php5-script .html

for PHP5, or

AddHandler php-script .html

for PHP4.

Posted by: Dag Nov 24 2006, 11:25 AM

Thank you Liam. Yes, I have that in htaccess. Actually:

DirectoryIndex index
RemoveHandler .html
AddType application/x-httpd-php .html

How I can write both? Means

AddHandler php5-script .html
AddHandler php-script .html

Because ISP supports both at the current moment and some of my scripts are 4 but some fromr PHP5.

Posted by: Dag Nov 24 2006, 11:40 AM

Just checked. No one of them are pushing PHP in html to work. I need php code inside html page to work / execute. Error 406 is solved of course but how about scripts?

Powered by Invision Power Board (
© Invision Power Services (