Prevent Google URL shortening automatically

When the user asks for a reset password, we send an email with a reset link shortened with Google URL Shortener.

The problem is that the link is visited before / without the user clicking. How can I prevent this?

// Google Shorten URL code.
$googer = new GoogleURLAPI($key);
$short_url = $googer->shorten($short_url);
return $short_url;`

      

+3


source to share


3 answers


You can not. Google will receive a link to get information from it (such as the name) as part of the shortening service.



Just submit your regular link like everyone else. You don't need to embed it on Twitter (where there is a limit on post length) or be posted on a billboard (where people should be typing it).

+2


source


I had the same problem and in fact checking the HTTP referee does not help as it does not display the GoogleBot in this case. I am assuming that the machine validating the url is not actually a crawl Google bot. The only way I found it to be Google that visits the url is to check the hostname of the IP address and look for the google name in it.



For example, execution host 66.249.88.231

in a shell.

+1


source


If you really need this solution, you can try to detect Google Bot on the reset page. It should send a specific user agent.

0


source







All Articles