1. How does one allow directory browsing in one specific directory when the following code is used in the root .htaccess file to prevent directory browsing in general:
IndexIgnore *
2. How does one allow hot linking to images in a specific folder when the following code is used in the root .htaccess file to prevent hot linking in general:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ - [F]
3. Is EVERY command for .htaccess inheritable? For instance, if I use:
AddType application/octet-stream mp3
in my /mp3 directory, is that the only place that will automatically download mp3 files?
Thanks,
m__
e-mail = codingforums AT couchfort DOT org
3rd question: Is EVERY command for .htaccess inheritable? For instance, if I use:
Yes, though technically that command in the /mp3 dir would affect all files within that dir, and all dirs within that dir (and the files within that dir, and on and on). Meaning that command in your root htaccess would cause all mp3 files to be octet stream throughout your entire site, unless there was a sub-ht that over-rode the filetype octet somewhere, and that overwriting would only apply in that sole directory and its subs.
2nd question: How does one allow hot linking to images in a specific folder when the following code is used in the root .htaccess file to prevent hot linking in general.
Use the RewriteEngine block in your global ht as you normally would, but then in the dir that you want holinking allowed, simply stick a new htaccess file that says, only:
RewriteEngine off
That simply turns off your hotlinking block for that directory and its subs (simple trick, but you'd be amazed how many people run into the same problem with the same exact request).
1st question: How does one allow directory browsing in one specific directory when the following code is used in the root .htaccess file to prevent directory browsing in general:
you would specify directives for specific directories. Ex:
<Directory "/full/server/path/to/dir/">
AllowOverride None
Options None
</Directory>
Hope it helps...
Thanks so much Feyd. (BTW, is your name a reference to Dune?)
3 - Thanks. That's exactly what I needed to know.
2 - Excellent.
This should be broken:
http://couchfort.org/images/nav01/thumb-vs.gif
This should be good:
http://couchfort.org/pubimg/e-skip-bo.jpg
1 - I'm getting a error 500 when I try to use this. I changed the dir path to the appropriate one. I've tried with and without quotes (I believe without is correct, right?). I've added this to both the root .htaccess file and the directory specifc .htaccess file?
Thanks,
m__
4 - How can I change this code to include subdirectories in the acceptable HTTP_REFERRERs (replacing www\.)?
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ - [F]
I'm reading the Apache guide (http://httpd.apache.org/docs/mod/mod_rewrite.html) for help, but I cannot figure out the REGEXP that would allow this...
(sorry, I'm new to this)
Thanks,
m__
MCookie
01-08-2003, 11:40 AM
Maybe this will help:
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://domain.com.* [NC]
RewriteCond %{HTTP_REFERER} !^http://www.domain.com.* [NC]
RewriteCond %{HTTP_REFERER} !^http://subdomain.domain.com.* [NC]
RewriteCond %{HTTP_REFERER} !^http://123.123.123.123.* [NC]
RewriteRule \.(gif|jpg)$ - [F]