So I wrote some php code to check the URL of the current site then pare it to the URL it should be located at and to e-mail me if somebody copy pasted my code and used it on there own site. Then I hit my head against my desk realizing that the PHP would be executed on the server and potential thieves would never even see that code.
So I keep trying to think of ways to stop a simple full copy paste of my website. Is it possible to do that sort of thing in java script or something that would inform me if my website was stolen or make it break if it was.
So I wrote some php code to check the URL of the current site then pare it to the URL it should be located at and to e-mail me if somebody copy pasted my code and used it on there own site. Then I hit my head against my desk realizing that the PHP would be executed on the server and potential thieves would never even see that code.
So I keep trying to think of ways to stop a simple full copy paste of my website. Is it possible to do that sort of thing in java script or something that would inform me if my website was stolen or make it break if it was.
Share Improve this question asked Jun 19, 2011 at 17:45 JoelJoel 5871 gold badge5 silver badges17 bronze badges 4- Perhaps something that googles for full sentences on your website? Seems a bit paranoid though, usually full copy pastes are only done for caching or things like thewaybackmachine. – Arend Commented Jun 19, 2011 at 17:48
- Are you certain that someone would actually want to "steal your site"? – No Results Found Commented Jun 19, 2011 at 17:51
- If you want to protect your source code, do not host websites on clients' servers. – Ondřej Mirtes Commented Jun 19, 2011 at 17:52
- 1 Just make your site in FrontPage or Dreamweaver, then no one will ever want to steal your HTML source code :) – No Results Found Commented Jun 19, 2011 at 17:55
5 Answers
Reset to default 3So I keep trying to think of ways to stop a simple full copy paste of my website
The short and long of it is that it's impossible. If your web site contains a specific design, it is protected by law. You may be able to fight blatant rip-offs through legal means.
Other than that, there's no reliable way to protect HTML source code.
You could check the domain name via document.domain
in Javascript, and if it doesn't match your domain, make an AJAX request to your server to send an email.
Make sure you obfuscate the code through uglify, minify, etc.
This would protect it from newbies copying your pages without reading the code, whereas decent programmers would be able to figure it out and remove it.
You can obfuscate Javacscript to make if more difficult to understand but even this is possible to disentangle and reuse. You can try the same techniques in HTML but again these are not impossible to reverse.
This is not really possible. You can verify HTML and Javascript on other websites but unless you are google, your server will never be able pare your websites's Html or JS with other website.
Just warn people in your code that using your code could lead them to a law suit.
You could add an invisible image to your code (. If the person copying your code is stupid enough not to check for this, request for this image for the other persons site will show up in you log with the refferer set to the other persons page url.