Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Grrr, .htaccess question……help please!

Want to let 2 sites share files…..but block all others from leeching



5:52 pm on Jun 27, 2003 (gmt 0)

10+ Year Member

Wow this forum is amazing so much info :)

Now here's my question........

I made a .htaccess file and all is good for blocking leeching on "mydomain1.com" but here's the tricky part!

I want to modify the file to >> allow me to have mydomain1.com and mydomain2.com block all outside picture linking, but allow the 2 sites to link pictures between them.

Does this make sense? Basically I want to put my index and html pages on one site(the main site)....and my pictures on another site. And block outside linking to those 2 sites……but allow...it between the 2 sites……?

This is the script I am using now

RewriteEngine On
RewriteCond %{HTTP_REFERER}!^http://www.mydomain1.com [NC]
RewriteCond %{HTTP_REFERER}!^http://mydomain1.com [NC]
RewriteRule [^/]+.(gif¦jpg)$ - [F]

thanks so much


6:31 pm on Jun 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

It should just be a matter of adding another condition rule:

RewriteEngine On
RewriteCond %{HTTP_REFERER}!^ht*p://(www\.)?mydomain1.com [NC]
RewriteCond %{HTTP_REFERER}!^ht*p://(www\.)?mydomain2.com [NC]
RewriteRule [^/]+.(gif¦jpg)$ - [F]

Also, I used a regular expression to save you from having a line for urls with www and without.

Note: don't forget to change the broken pipe back to a solid one and also be sure to add the space between the second curly brace and the exclamation point.


6:42 pm on Jun 27, 2003 (gmt 0)

10+ Year Member

thanks so much! I will try it when I get back home from work in a few hours....and post up my results here.....

thanks again


1:01 am on Jun 28, 2003 (gmt 0)

10+ Year Member

awesome its working!

btw: snipped.com

are the sites :)


[edited by: DaveAtIFG at 3:03 am (utc) on June 28, 2003]
[edit reason] No specificics please! [/edit]


Featured Threads

Hot Threads This Week

Hot Threads This Month