Chris Dowdeswell
Chris Dowdeswell

Reputation: 868

Server locale xmlhttp requests recognised as wrong language by remote servers?

I have a web server hosted with 1and1 which evidently is hosted in Germany, so if I try to do a xmlhttp get on data from google or facebook I am presented with German return data as their site presumes I am a German user.

Does anyone know if it is a server setting which needs to be changed or is facebook recognising the IP location?

Upvotes: 0

Views: 227

Answers (1)

字姓名
字姓名

Reputation: 436

if the resource is available in two or many languages, the server mast decide which version to serve. he does this often by examining Accept-Language HTTP header. Probably the header in the request issued by yur server says that it accepts any language, so the server prefers to send german not english due to your srever's IP. Try to add the header menually to your request:

Accept-Language: en

so your ajax will look like this:

xmlhttpobject.setRequestHeader('Accept-Language', 'en');

Upvotes: 1

Related Questions