.htaccess tutorial

htaccess Elite


Multiple Commands in one htaccess?

Anything not fitting into other categories

Multiple Commands in one htaccess?

Postby Morbius » 26 Sep 2008 04:21

I have two things I'm trying to accomplish with my htaccess. These are commands that I've gathered from around the net, but I don't know the proper way to place them.

Basically it seems that the server sees the first command and ignores the rest.

Code: Select all
Options -Indexes
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?site1.com(/)?.*$     [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?site2.com(/)?.*$     [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?site3.com(/)?.*$     [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp)$ - [F,NC]


The goal of this is to prevent folder browser, and prevent access to images from other URLs.

Right now the only part of this that works is the folder browsing, but only if I put that line at the top.

So is there a fix to this?
Morbius
 
Posts: 1
Joined: 26 Sep 2008 04:17

Return to Main