Google Maps API HTTP Restrictions: how to use wildcards?

Viewed 4135

Based on documentation here

I added http restrictions using wildcards like so:

This should cover all paths for all subdomains, but I receive RefererNotAllowedMapError error when I try to use https://www.dev.mydomain.com/#/

I even tried explicitly adding https://www.dev.mydomain.com/#/, but I get same error.

I am totally lost and have no idea what to do. Clearly other people are using Google Maps APIs and not leaving them totally unrestricted so there has to be a way to do this.

1 Answers

Try adding these two HTTP restrictions instead:

  1. *.mydomain.com/*

  2. mydomain.com/*

These two will allow your API key to be used in all sub-domains and paths in your website.

Adding (*.) before your domain will allow something like "www.mydomain.com" or "dev.domain.com" to access your API key.

Adding (*) after your domain will allow something like "domain.com/path" to access your API key.

Related