A
A
askold20132017-09-13 14:52:09
htaccess
askold2013, 2017-09-13 14:52:09

How to protect html and css from copying?

Hello! There is the following problem - there is a static site (layout) and I need to somehow protect it from copying. More precisely - copying html css js. I've heard of course that it can't be done for sure. But I would be satisfied with any way to protect against the average copirons. I tried this .htaccess

<FilesMatch ".(htaccess|htpasswd|ini|phps|fla|psd|log|sh|html|css|js)$">
 Order Allow,Deny
 Deny from all
 </FilesMatch>

And put it in the root of the site. To which the site immediately gave me a 403 error.
I saw this option:
<FilesMatch ~ "\.(php|htm|html|js)$">
  Order allow,deny
  Deny from all
</FilesMatch>

But it doesn't work either (at all). I download through the context menu - Save as. How can this be removed?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Psq, 2017-09-13
@Psq

html css js - files that are downloaded to the client to display the page correctly.
Through .htaccess you restrict access to files, and, accordingly, if you specify these extensions, then you restrict access to the site to everyone (Deny from all).
Since this data is uploaded to the user (and should be uploaded), you have no way to restrict access to it completely.
The only option, against "stupid" users, is to intercept "shortcuts" (example - changing text when pressing Ctrl+C). Smart ones, in turn, will either open the developer tools, or simply use a site download utility (for example, wget).
Upd: Read about obfuscation: https://habrahabr.ru/company/xakep/blog/128741/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question