View Single Post
Old 05-18-2005, 02:37 AM   #1 (permalink)
elspeth
Registered User
 
Join Date: May 2005
Posts: 4
elspeth is on a distinguished road
Question Htaccess problems

I'm having a problem with my htaccess file and I hope someone can help.
I initally had a file that stopped hotlinking and a loaded a 404 error page. But when I updated my site and removed a lot of the images that originally had been hotlinked, I thought I could also remove the hotlink codes in my .htaccess file. But now I'm being hotlinked yet again.
So I tried adding the same codes to the file again (saved as .txt file and uploaded using ascii and then renamed file to .htaccess) ... my 404 page loaded fine but the hotlinked images are still loading.
I contacted my provider and they sent me codes to use:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ - [F]

I uploaded this to my dir folder (after I had replaced "yourdomain.com" with my own info)and it wiped my site! So I moved it to the image subfolder where it successfully stopped the hotlinking, but also stopped my own images from showing. Not really what I was after.
So my question (sorry it's so long winded!) is how do I create a .htaccess code that will include both a 404 and stop hotlinking and actually work!!
I have several sub-domains on my domain and img folders in those sub-domains.
I run WinXP and I've been using both WS_FTP and FTP Navigator to upload files... if that is of any help.
elspeth is offline   Reply With Quote