Prohibit other sites from using my content

Asked

Viewed 69 times

0

Hello, I am trying to develop an htaccess code that prevents other sites from using my content. I tried this, but without success, if I type in the browser given file/link it is inactive even for me, and it was to be for another person/site and on my site be accessible normally.

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?meusite\.com\.br/ [NC]
RewriteCond %{HTTP_REFERER} !^$RewriteRule .*\.(jpe?g|gif|bmp|png)$ /imagens/proibido.jpg [L]

Could someone help me?

  • do not understand you want to prohibit the user from accessing a certain url ? or you that I forbid the user to copy/embed from your page ?

  • I want to make me use for example: meusite.com/video.mp4 on my site, and if someone else tries to access it to put on your site, there will be how, in short, all the content of my site would only be played to my site and not to third parties, such as taking the link and placing it inside an iframe

  • you use Cpanel ?

  • Yes, I use Cpanel

  • This will not work even if the code "works", websites can still use your content. If they do not use the crossorigin in the img and use the referer-policy: no-referrer (same-origin), this will make the browser not inform the referer. :D

  • I have this doubt, because I see on site that has links with endings . m3u8, that if I use them on my site, does not play, is kind of a domain protection.

Show 1 more comment

1 answer

1


Good What you are looking for calls Hotlink which is a way to prohibit people from doing Usu of your files thus generating use of Bandwidth you can use a code similar to this

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com [NC]
RewriteRule \.(jpg|jpeg|png|gif|mp4|)$ - [NC,F,L]

If not turn it on by Cpanel (as you use Cpanel) in inserir a descrição da imagem aqui

Here you can read an article on the subject Hotlink what it is, and how to protect yourself

You can generate your custom . htaccess here

Browser other questions tagged

You are not signed in. Login or sign up in order to post.