.htaccess question

software development

#1

i can’t find a tutorial that seems to answer what i need.

how can i prevent hotlinking from ALL of mysite.com with an EXCEPTION of a single folder and it’s subfolders?


#2

.htaccess works on a folder plus its subfolders. I don’t know how to disable for a single directory, but you could, create a .htaccess file for one folder then copy that file and paste into any other folder that needs protecting. disabling hotlinking can be done in your control panel, just specify what directory you want to protect, what extentions are to be blocked and what domains have permission to access those extentions.
In your control panel, click on goodies, then htaccess/webdav, click on the domain or subdomain you want to protect if you have more than one, then fill in the blanks.
Silk

My website


#3

thanks silk, i appreciate the input.

my main goal is to prevent having to update each individual directory should i need to change the .htacess file.

would creating a symbolic link in each directory work?


#4

.htaccess supports inheritance. Use one that restricts everybody’s access at the top level. Then make a new one allowing hotlink access in the appropriate subdirectory.

From http://docweb.cns.ufl.edu/docs/d0123/d0123.html#id2696016

[quote]Inheritance of Restrictions
Your .htaccess file and its corresponding username/password file (if any) restrict access to the subdirectory in which .htaccess is located, and all subdirectories below it. This inheritance can be over-ridden by placing another .htaccess file in one of the subsidiary subdirectories, in which case the restrictions imposed by each .htaccess file apply to the directory in which it is located and are inherited downward from that point.[/quote]
http://corz.org/serv/tricks/htaccess2.php
http://cooletips.de/htaccess/
http://apache-server.com/tutorials/ATusing-htaccess.html
http://www.htmlbasix.com/disablehotlinking.shtml

BC Tech
Team Shocker


#5

excellent pangea! that will work perfectly :slight_smile:


#6

my respect to all posters. wasn’t trying to jack the thread, and see they were on point. i just wrote my post in a text editor and posted without reviewing the others up til that point.

BC Tech
Team Shocker