Greenguy's Board


Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 2006-10-17, 09:35 AM   #1
sspproductions
Rock stars ... is there anything they don't know?
 
Join Date: Jun 2006
Posts: 19
Send a message via ICQ to sspproductions
Question htaccess nightmare

Hi guys

Hope you can help with this one

I have got to create a htaccess file that blocks sites like fusker and hotlinking but allows me to get the content for my two sites from the one subdomain where the content is stored.

I think this would work but not sure


RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://subdomain.mysite.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://subdomain.mysite.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://subdomain.mysite.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://subdomain.mysite.com/.*$ [NC]
RewriteRule .*\.([gG][iI][fF]|[jJ][pP][gG])$ - [F]

order allow,deny
deny from all
allow from mysite1.com mysite2.com


oh yeah does this solve the problem where people can look in the directory if they type it in?
thanks
sspproductions is offline   Reply With Quote
Old 2006-10-17, 09:53 AM   #2
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
hotlinking FAQ

First, the RewriteRules you have will do what you want. They aren't the best way, they miss a number of potential cases, but, in general should protect you pretty well. I would suggest that you use what is in the FAQ over those. to add another domain to the list, just copy the line that says yourdomain\.com and replace yourdomain\.com with anotherdomain\.com

However, the
deny from all
allow from mysite1.com mysite2.com

This will cause quite a bit of havoc.

First, every request that comes into your site will require a DNS lookup. Secondly only the people surfing from the servers mysite1.com and mysite2.com will be able to see the content. Note: from the server, not some surfer sitting at home using bellsouth, only your web servers will be able to surf your sites (and depending on how your server is configured, if they are on virtual IP addresses, they would probably not even be coming from that IP. Definitely not what you want.
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote
Old 2006-10-17, 11:28 AM   #3
sspproductions
Rock stars ... is there anything they don't know?
 
Join Date: Jun 2006
Posts: 19
Send a message via ICQ to sspproductions
Oh my

Thanks sparky I would rather be fuskered than not have customers be able to see what they bought

That will cover me for the content outside the members area but i missed the bleeding obvious AGAIN... I use ccbill so now its over to them.

Thanks again
sspproductions is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:53 AM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc