Skip to content
tech.tutulutu.ee
Simple Blog about Tech – written for myself. Use with caution.
  • Home
  • Links
command-line

How to prevent a file from direct URL Access using htaccess

Posted February 16, 2024
RewriteEngine on 
RewriteCond %{HTTP_REFERER} !^http://(www\.)?localhost [NC] 
RewriteCond %{HTTP_REFERER} !^http://(www\.)?localhost.*$ [NC] 
RewriteRule \.(gif|jpg)$ - [F]

Thanks to https://stackoverflow.com/questions/10236717/how-to-prevent-a-file-from-direct-url-access

htaccess

Post navigation

Older post
redirect webpage and subfolders to another website
Newer post
Prevent access to folder and add a message using htaccess

Recent Posts

  • Docker compose docs
  • How I restored my system when docker volumes wrote disk full
  • Firefox: turn off offering translations
  • How to fix headers sent error on PHP
  • My dd command on linux to copy entire disk to img file

Categories

  • Angularjs
  • apache
  • Atom
  • aws
  • bootstrap
  • command-line
  • css
  • docker
  • firefox
  • Git
  • gmail
  • https
  • Java
  • jQuery
  • LAN
  • laravel
  • linux
  • music
  • MySQL
  • network
  • nginx
  • nodejs
  • npm
  • php
  • phpunit
  • printers
  • Python
  • Sailsjs
  • sql
  • ssh
  • SSL and HTTPS
  • thunderbird
  • Uncategorized
  • vim
  • web
  • woocommerce
  • wordpress

Tags

add user angularjs atom aws bootstrap browser command line composer cron css docker dpkg find find file firefox gedit htaccess html htpasswd https install soft ip java laravel linux music mysql nautilus network nginx npm php phpunit port proxy rsync s3cmd scp server ssh thunderbird ubuntu visudo woocommerce wordpress
© 2025 tech.tutulutu.ee
Powered by WordPress | Theme: Graphy by Themegraphy