PC & IT SUPPORT MADE EASY FORUM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Full and Partial Content Blocking VIA htaccess file

Go down

Full and Partial Content Blocking VIA htaccess file Empty Full and Partial Content Blocking VIA htaccess file

Post by jamied_uk 10th April 2021, 15:09

First create a .htaccess file

Code:
sudo gedit .htaccess



Full Blocking Method (prevents even playing content and direct access)


Code:
<Files ~ "\.mp4$">
  Order allow,deny
  Deny from all
</Files>




Another Better Method (better as it allows content to play) Blocks direct access!


Code:
RewriteEngine On
RewriteCond %{HTTP_HOST}@@%{HTTP_REFERER} !^([^@]*)@@https?://\1/.*
RewriteRule \.(gif|jpg|jpeg|png|tif|pdf|wav|wmv|wma|avi|mov|mp4|m4v|mp3|zip?)$ - [F]
jamied_uk
jamied_uk
Admin

Posts : 2951
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum