Mod_Rewrite Folder/Site Blocking

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
tecktalkcm0391
DevNet Resident
Posts: 1030
Joined: Fri May 26, 2006 9:25 am
Location: Florida

Mod_Rewrite Folder/Site Blocking

Post by tecktalkcm0391 »

OK, this might seem a bit weird but this is the only way I can have it set up.

I have a site setup, with a folder in it. (Site.com/Folder)
I have another site (site2.com) hosted on that server that gets its files from (site.com/folder)
How can I block people from going to site.com/Folder, but not from site2.com.

I've already tried:

Code: Select all

AddModule mod_setenvif.c
SetEnvIfNoCase Referer www\.site2\.com SITE_1
SetEnvIfNoCase Referer site2\.com SITE_2
<Files>
Order deny,allow
Deny from all
Allow from env=SITE_1
Allow from env=SITE_2
</Files>
and...

Code: Select all

RewriteCond %{HTTP_REFERER} !^http://site2.com/.*$     [NC]
RewriteCond %{HTTP_REFERER} !^http://www.site2.com/.*$     [NC]
RewriteRule .*\.*$        -                  [F]
HELP!
Post Reply