Help - Search - Members - Calendar
Full Version: Content negotiating
HTMLHelp Forums > Programming > Web Server Configuration
Dag
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?

Samples:
error 406 -- http://www.be1.ru/stat/?url=http://www.orw...u/library/index
good one -- http://www.be1.ru/stat/?url=http://www.orw...rary/index.html

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


Thank in advance,

Dag
Liam Quinn
The 406 error is something that you should correct. Right now, a browser that sends "Accept: text/html" gets a 406 error from http://www.orwell.ru/library/index :

$ curl --head -H 'Accept: text/html' http://www.orwell.ru/library/index
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.
Dag
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
AND
AddHandler php-script .html

Because ISP supports both at the current moment and some of my scripts are 4 but some fromr PHP5.
Dag
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?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2019 Invision Power Services, Inc.