Is there a way to get 'HTTP Referrer' restriction working with Google API (via PHP)?

174 Views Asked by At

I am using the Google API Console and would like to restrict based on website (HTTP) referrer instead of IP, as the IP could change eg with hosting change.

The IP restriction works fine, but when I switch to website restriction and add my website with some wildcard characters, eg: http://example.com/* it fails.

My assumption is that since the code is running on the server (PHP) that it is by default showing the IP, not the domain name.

Is there any way around this - ie to ask the server via PHP to "report" the website domain name as a referrer instead of the IP address so that I can use the HTTP referrer restriction option? Or am I stuck?

0

There are 0 best solutions below