Programmatically determine if someone owns a site?

I need to figure out the best way to determine if someone is the actual owner of the website. I do not mean only the domain, although in many cases this may be so.

My first wish was to get them to put a special comment in their HTML that my program could clear. eg:.

<!-- @webcode:1234 -->

One possible problem with this approach is that someone could theoretically add it to comments on their page or some other way to add content. Although I am not sure that everything that I have cannot be achieved.

My other idea was that I also planned to offer a JavaScript widget to just clear it, although I did not want them to force them to add a widget.

<script type="text/javascript" src="http://yoursite.com/widget/widget/A4923D2342JF"></script>

What other mechanisms can be used to determine ownership / control on a website?

+3
source share
7 answers

Here are the options Google uses to verify the domain :

  • Create a CNAME or TXT record in your DNS. These methods require access to the DNS settings for your domain on the host of your domain Web site. Which method you can choose (CNAME or TXT Record) depends on what was offered in your Google Apps control panel. We are currently deploying a TXT recording method, but are still asking many clients to create a CNAME, instead.

  • HTML -. . , DNS.

  • ( , ). , . , , .

CNAME/TXT HTML , . , node, - . , .

+9

, Google -. . , , , <head></head>. , .

+4

<head>. , , , .

, , , . , , , , HTML.

+2

, , , <header> -. , , , .

, : include the special comment in the header section of your page.

+2

- . , HTTP, .

, , ( - ).

URI, . , - , . - , .

, , , /; , , . , , , . , , .

-1
source

I know that you mentioned that this does not necessarily depend on the domain, but it will help. You can hash a domain (since they are unique) and send this line to a person to place either .txt or in the header somewhere on your site, as others have mentioned.

Then you save all your domains and their hashes in the database, and your scraper will check that the domain that it clears matches the hashed comment line, if it checks, then this is normal.

-1
source

Source: https://habr.com/ru/post/1757268/


All Articles