...

View Full Version : .htaccess help



chiefbutz
04-03-2005, 01:58 AM
OK i want to make it so that when an image is hot linked it showes a different image. I ahve the code that SHOULD do that. It does that, but i have the code in there that should allow direct linking (viewing it form the browser). The viewign formthe browser part doesn't work! Here is my .htaccess file:


<Files ~ "^\.ht">
order allow,deny
deny from all
satisfy all
</Files>

Options -Indexes

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://megars.illusionfxnet.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://megars.illusionfxnet.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.megars.illusionfxnet.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.megars.illusionfxnet.com$ [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ http://img220.exs.cx/img220/1497/x1ul.jpg [R,NC]


This does not allow the the viewing of .htaccess or .ht* files


<Files ~ "^\.ht">
order allow,deny
deny from all
satisfy all
</Files>


This disables indexes

Options -Indexes

This is the hotlinkign part



RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://megars.illusionfxnet.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://megars.illusionfxnet.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.megars.illusionfxnet.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.megars.illusionfxnet.com$ [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ http://img220.exs.cx/img220/1497/x1ul.jpg [R,NC]


The first line i knows make sit so you can disabel the hotlinking
The next line is what SHOULD allow things that are directly linked
The next 4 lines say that my site is ok for images to be shown
the next line says that anythign with the extension i specify is not shown

well the part for direct linking doesn't work!

I also want to learn all the thing you can do in the htaccess file and how, so i can write a generator. The thing Cpanel has isn't exactly that good...

Noodles24
04-03-2005, 11:31 PM
This is my hotlinking .htaccess file:



RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://www.bmw-forums.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://bmw-forums.com/.*$ [NC]
RewriteRule \.(gif|jpg|jpeg|png|GIF|JPG|JPEG|PNG)$ http://www.bmw-forums.com/piclink.gif [L]


This one works fine



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum