vendredi 28 novembre 2014

google recaptcha V2 on apache shared server: How to get it to work with SSL



I implemented google's reCAPTCHA V2 on http:// on the remote apache shared server and it worked 100%. I then changed the protocol to my shared server SSL using the same script as the non-SSL script. The older version of reCaptcha had an SSL 'false' to 'true' SSL parameter, whereas I can't find one for V2. I had to use htaccess to redirect the example.com to the shared SSL server https: //serverid.net/example/ which works perfectly without recCAPTCHA. I incorporated reCAPTCHA V2 and the error message where the reCAPTCHA image should be shows "ERROR: Invalid domain for site key".


Here's the htaccess: RewriteEngine On RewriteCond %{HTTP_HOST} ^(.)example.com [NC] RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.)$ http://ift.tt/1FDP6SC$1 [R,L]


Here's the recaptchalib.php code in case that helps:

(http://ift.tt/1ysehXT)


Anyone know how to make this work?





Aucun commentaire:

Enregistrer un commentaire