The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Content negotiating, Error: 406 Not Acceptable
Dag
post Nov 23 2006, 03:55 PM
Post #1


Member
***

Group: Members
Posts: 89
Joined: 24-October 06
Member No.: 549



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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Liam Quinn
post Nov 23 2006, 10:27 PM
Post #2


WDG Founder
***

Group: Root Admin
Posts: 52
Joined: 2-August 06
From: Canada
Member No.: 1



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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Dag
post Nov 24 2006, 11:25 AM
Post #3


Member
***

Group: Members
Posts: 89
Joined: 24-October 06
Member No.: 549



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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Dag
post Nov 24 2006, 11:40 AM
Post #4


Member
***

Group: Members
Posts: 89
Joined: 24-October 06
Member No.: 549



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?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 16th December 2019 - 07:23 AM