23

I have registered an account on recaptcha.net with mydomain.com.

While I'm developing on my localhost it works fine, but whenever I try to open the page from another machine in my local network it shows "input error: invalid referer" error message!

I'm not using recaptcha plugins.

4 Answers 4

28

reCaptcha keys are tied to a certain domain + localhost (when you got your private/public keys from them). You can use it on another domain by requesting new private/public keys or by using a global key.

From their website:

  • By default, your reCAPTCHA key is restricted to the specified domain, and any subdomains for additional security. A key for foo.com works on test.foo.com.

  • If you wish to use your key across a large number of domains (e.g., if you are a hosting provider, OEM, etc.), select the global key option. You may want to use a descriptive domain name such as "global-key.mycompany.com"

  • If you own multiple domain names (foocars.com and footrucks.com), you can sign up for multiple keys, or use a global key.

2
  • damn, so I'm trying to get my pull request approved and the captcha has to work, one of my team mates tried testing, without the captcha being verified the thing doesn't run through without giving that error . . . .the website uses this key, I can't change it. it's been this way for almost 10years now and I've been here for a month, what do I do? :( Apr 1, 2014 at 8:40
  • sweet, made an if to check if it was running on live or on dev. . .or anything else Apr 1, 2014 at 14:12
3

It seems that Google has removed the Global Key for reCaptcha, as you can see here.

In your localhost it works fine because your are using the keys provided to your domain. But when you upload the code you your production server, it seems that you are using the same keys to multiple domains (even though localhost might not be considered a domain). So you got that error. I fixed that creating new keys to another domain of mine and adding them to my localhost script. And to the production script, I kept the keys for that domain.

1

i have the same problem, i solve it to add my server ip adress from recaptcha admin screen;

Click the over your domain name which are listed under header Your reCAPTCHA sites and add your ip at Key Settings -> Domain so problem is solved.

0

As Andre mentioned before - the global key was removed for reCaptcha. But you can use secure token You'll find my solution for PHP here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.