locked
What's wrong with this recaptcha code? RRS feed

  • Question

  • User-2071692902 posted
    Hi all,
     
    I have tried to use the below code"recaptcha code " in my site but when I open the page it gave me message in red color.
    THe message is :
    "Localhost is not in the list of supported domains for this site key."
    <script src='https://www.google.com/recaptcha/api.js'></script>
    <div class="g-recaptcha" 
    data-sitekey="6Ldbdg0TAAAAAI7KAf72Q6uagbWzWecTeBWmrCpJ">
    </div>
    So what is the wrong with this code ?

    Wednesday, February 19, 2020 3:45 PM

Answers

All replies

  • User-474980206 posted

    when you register for your key, you specify the hostname of the site hosting recaptcha. you need to register localhost get a  key for localhost

    Wednesday, February 19, 2020 4:43 PM
  • User-2071692902 posted

    I went to this site https://www.google.com/recaptcha/admin/create .

    But it gave me a wrong message when I enter my domain (This is my domain appleschat.com/).

    The message is 

    The following domains are invalid: appleschat.com/. A valid domain requires a host and must not include any protocol, path, port, query or fragment.

    Wednesday, February 19, 2020 4:57 PM
  • User2053451246 posted

    Don't include the forward slash /

    Also, registering localhost no longer works if I remember correctly.

    Wednesday, February 19, 2020 9:45 PM
  • User1535942433 posted

    Hi Omanxp45-1,

    Accroding to your description,I create a test.I suggest you could publish your localhost website and Set Custom Domain Name.The domain you could write just like this:

    www.website.com

    More details,you could refer to below articles:

    https://developers.google.com/recaptcha/docs/faq#localhost_support

    Set Custom Domain Name for localhost Website in IIS:

    https://www.tutorialsteacher.com/articles/set-custom-domain-name-for-localhost-website-iis

    Best regards,

    Yijing Sun

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, February 20, 2020 2:56 AM
  • User-2071692902 posted

    Still the same message appears to me 

    Localhost is not in the list of supported domains for this site key.
    

    Here my website  www.appleschat.com

    And here my email omanxp45@gmail.com

    Thursday, February 20, 2020 7:12 AM
  • User1535942433 posted

    Hi Omanxp45-1,

    Accroding to your description ,as far as I think,your google domain may have problem.I suggest you could reset the domain.

    More details,you could refer to below article:

    https://support.google.com/a/answer/35232?hl=en&ref_topic=29165

    Best regards,

    Yijing Sun

    Thursday, February 20, 2020 8:51 AM
  • User-2071692902 posted

    Hi yij sun,

    You mean should I connect with my domain host and tell them to reset my domain?

    Thursday, February 20, 2020 11:34 AM
  • User1535942433 posted

    Hi Omanxp45-1,

    As far as I think,I suggest you firstly could check whether setting  Custom Domain Name for localhost Website in IIS is right.

    Then if you still have problem ,you could reset your domain.

    Best regards,

    Yijing Sun

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, February 21, 2020 8:26 AM