4

We have a new website(say www.website.com) on Server B which is not live yet, which is using google maps on a page.

The old version of the website is on Server A is not using google maps.

I have created a browser key with domain name - www.website.com and in my hosts file set the IP address of Server B with www.website.com and tried to test google maps, but it is not working.

This is the error I am getting -

"Google Maps API error: Google Maps API error: RefererNotAllowedMapError https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error Your site URL to be authorized: http://www.website.com/page-that-has-google-map

Any suggestions on how to fix this issue? I want to test the google maps page on Server B and make sure the page is working fine before making the website on Server B live.

TIA

lambda8
  • 317
  • 1
  • 4
  • 17

1 Answers1

6

the website name is www.website.com, but I added website.com, so when I added *.website.com/* to browser key API, that fixed the issue.

geocodezip
  • 158,664
  • 13
  • 220
  • 245
lambda8
  • 317
  • 1
  • 4
  • 17
  • 1
    For some reason that did _not_ work for me (even though it's the suggested syntax on console.developers.google.com). What I needed to do was add the actual protocol too; `http://website.com/*` is the only one I need now. – powerbuoy Jul 25 '16 at 20:50
  • 1
    @powerbuoy This is because your domain does not have a prefix (i.e. www.), so [*.website.com/*] would not be valid. There's no initial full stop. – James Kemp Aug 16 '16 at 18:43
  • Actually it did have a prefix. The protocol is what solved the issue. For me anyway. – powerbuoy Aug 16 '16 at 19:03