0

I've my ruby on rails website registered as a subdomain under godaddy.com

It works fine. But when I try to get the window.location.host, It returns the IP address of my server and not the domain name.

Because of this I'm getting the following error with my google picker js api:

    Incorrect origin value. Please set it to - (window.location.protocol + '//' + window.location.host) of the top-most page

Can anyone help ?

Sana
  • 319
  • 1
  • 3
  • 18
  • If you see actual sub-domain in address bar but different host in location.host then some script has overridden it. But it is hard to over-ride window.locaion. Please check what is there in window.location? http://jsbin.com/welosote/1/edit?html,js,output – amitamb Jun 23 '14 at 12:51
  • Yes.. The actual subdomain name is displayed in the address bar, but in window.location I get the IP address of that subdomain itself. – Sana Jun 23 '14 at 13:06
  • Is that code/window in iframe? – amitamb Jun 23 '14 at 13:07
  • Yes. I've not used any iFrame, But on browser it's getting enclosed by an iFrame with src = 'IP address' – Sana Jun 23 '14 at 13:11
  • That's the issue then. You can't do anything expect using that IP address as your domain name. (BTW might want to talk with GoDaddy folks if there is work around). – amitamb Jun 23 '14 at 13:15
  • But I can't use the IP address with Google Picker API. Thats the main issue. Is there any way to remove this iframe, by changing any settings with godaddy (in case you have any idea about it) ? – Sana Jun 23 '14 at 13:22
  • Don't know. You are using GoDaddy for hosting as well I assume. If not everything is under your control and it seems odd that GoDaddy would impelment hosting that way. – amitamb Jun 23 '14 at 13:25
  • Yeah.. I've mentioned in my question that my site is under godaddy only. But thanks for all your help @amitamb – Sana Jun 23 '14 at 13:28
  • thanks @amitamb ... the issue was with godaddy hosting.. it was hosted with IP forward and masking.. thanks for your help :) – Sana Jun 28 '14 at 14:30

1 Answers1

1

This is because the domain might be set in domain forwarding mode. The domain needs to actually point to the IP which is different than domain forwarding.

user1097111
  • 662
  • 5
  • 15