How to protect my website from being copied?

Hello,
This is my first post here and I’m very glad to join this precious forums. I would like to make sure if these steps that I’ve made protect my website properly or not.

  1. First, I typed this code Options -Indexes in the file that is named .htaccess
    This will prevent accessing/sharing the directories of my website so that users cannot access the codes unless they are on my website. I mean visitors can only execute/run the code if they are on my website.

  2. I’ll not write any codes in the index.php page. I’ll refer the codes instead such as: <script src="myscripts.js"></script> and sometimes I will use PHP.

Is this a good way to protect my website and my own codes from being stolen? It would be hard for me to copyright it using a license. I cannot be protected by the law because I’ve never done something like this before and It requires experience. It might be too expensive to ask a lawyer. The earnings from that website will not cover those costs. Moreover, I live in a third-world country where nobody invents anything and copyright laws here are too weak or maybe there are no copyright laws at all (I’m not sure). That’s why I prefer to protect it technically.

1 Like

I’m not sure what you’re trying to protect, but you’re probably fighting a losing battle.

All I need to do is to look at your page source, find the link to the Js and paste the link directly in my browser.

PHP won’t conceal anything. It is parsed by the server before being sent to the browser.

Exactly what kind of code are you trying to protect, and why?

5 Likes

Hi benkyearn, welcome to the forum!

1 - Then you are protected from other sites “hotlinking” content from your site. That’s good.
Also make sure visitors can’t access site directories, only the directory’s index file and linked files. That can be user friendly done by having a default index file in each directory, e.g. an index.html, that could be empty or links or redirect to the start page, likely the index.php file in the site’s root directory.

2 - As @TechnoBear pointed out, anything the visitor can access can be copied.
There are many threads here about that subject, I’d like to referr to what a knowledgeable late member of this forum answered on this: Protecting website contents - "Anti copy" controls - #2 by felgall

3 Likes

Thank you all your answers. I really appreciate that.

It’s not a top-secret website :smile: It’s an ordinary website with some online tools such as online editor made especially for transcribers…etc. I will install some ads and earn money. I just would not like someone else to copy my codes and upload my website to another server and earn the money.

I’ve made a temporary website to do some tests and experiments:

The links to the directory files are easy to access:
http://transcribe.rf.gd/Nav/a.html
http://transcribe.rf.gd/Nav/b.css

By viewing the source code of http://transcribe.rf.gd the total code will appear and php doesn’t hide anything as you said earlier.

I’ve read the thread provided by @Erik_J. Now, I know that I can’t protect my website totally. Is there any way to eliminate copying my website? Or making it hard to copy?

2 Likes

Hey there, I may be a little off topic here, but if you just want that somebody else shouldn’t be able to copy your website and earn from it then why don’t you just get a copyright for your site and get it indexed on the search engines of your choice. Then even if someone tries to copy it the search engine would just penalize it for being a copy thus fulfilling your objective.
Hope this helps, pardon me if I didn’t get it right though.
Cheers.

This isn’t an HTML issue, so I’m moving your topic to General Web Dev, where hopefully somebody will be able to offer advice.

Thank you so much for your reply. Please, don’t apologize because I really appreciate every answer.

I did a little search and I found out that I can get a free license from https://creativecommons.org I hope this website is reliable. And I still have questions. How can I found out that someone copied my website? And how to tell search engines to penalize them? Or Do search engines detect it automatically?

Would you give me hints or links, please? and I’ll continue searching by myself. Thank you so much for your time :blush:

Hi,
not sure how your website function you are trying to protect works but if you are using javascript to do some processing then it can be easily copied and used again. If you use a serverside language (eg PHP) to do the processing and just output the answer then a user won’t be able to copy that. E.g if you had a simple calculator to add 2 boxes together and used JS i would be able to lift that from your site and put it on mine in a matter of moments. If you used php to add those boxes together and just output the answer i would have to re-create the logic to get it to work on my site (obviously very simple in this example).

If that makes sense.

3 Likes

As far as the Page Authority and the Domain Authority of that website which you’ve given is concerned it does appear to be reliable. The next thing, as to how would you know if someone has copied your website or not cannot be achieved in it’s complete sense because you can use “Google operators” to check similar results but once again even if the other guy has made a close copy you’ll have to spend quite some time to go through it and then coming to any specific conclusion.
Lastly, you don’t have to worry about telling the search engine to penalize the impostor as your search engine would do that on it’s own for you.
Cheers.

1 Like

Hello,

This is the very informative post. How to avoid the copying of website has been explained greatly.

1 Like

Hi there, although you cannot really protect the code from being copied you could very well obfuscate the JavaScripts and prevent anyone from understanding what is going on with them. There is this tool called uglify-js which basically will rewrite your code to be unreadable (change variable names, minify etc…).
That might actually help you protect your code from being ripped…

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.