How can I find shortened URLs that link to a specific long URL?

浪尽此生 提交于 2019-12-12 16:44:43

问题


This is the reverse of the usual expanding short URLs question.

For a given Long URL, how can I find which short URLs link to it?

If this needs to go through the APIs of the shorteners, apointers ot the ones which support such a query would be appreciated.


回答1:


Simple answer: submit the URL to each URL shortener that you're interested in.

  • If the URL has been shortened before you'll be given the same short URL that anyone else submitting your URL got back.
  • Otherwise, you now have a new short URL! No harm in this really.



回答2:


I do not think that there is a direct way to do this. For example, I could write my own URL shortener tomorrow - and since the shortURL->longURL mapping is private, on my server, I would need to provide you with a way to access that information.

So if you have control of the website, you might be able to glean information from looking at the server logs - the REFERER header, in specific.

I know that for bit.ly, it would be easy for you to shorten the URL there, and that would give you its corresponding shortURL. This same short url is used for anyone who uses bit.ly, unless someone has registered an account.



来源:https://stackoverflow.com/questions/1022803/how-can-i-find-shortened-urls-that-link-to-a-specific-long-url

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!