PDA

View Full Version : Where do I put the .htaccess if I want to prevent bandwidth stealing?


Gutspiller
08-01-2003, 07:47 AM
Do I put the .htaccess in my forum directory if I want it to display a different image when people try and link to my attachments?

Also, I was told something like this would work at replacing attachments with my own image:


RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://3dnewz.com.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.3dnewz.com.*$ [NC]
RewriteRule .*\.(gif|GIF|jpg|JPG|mpg|MPG)$ http://www.3dnewz.com/images/banners/stealer.jpg


will that code work with forum attachments and would I just place the .htaccess file in my forum directory? Also, I heard that CuteFTP is unable to see .htaccess files already on the server. Does anybody know if this is true? I don't want to overwrite anything that needs to be there.

Thanks.

Erwin
08-01-2003, 01:40 PM
Put the .htaccess in the highest directory where you want to protect the files in that directory and its sub-directories - so put it in root if you want ALL subdirectories to be affected, or in /images if you want all subdirectories in /images to be affected.

Best to do this in SSH rather than FTP as some FTP programs cannot see .htaccess files.

NTLDR
08-01-2003, 01:49 PM
See if there is an option to view hidden files in CuteFTP. In *NIX files starting with a . (eg .htaccess, .bashrc) are hidden.

Gutspiller
08-02-2003, 05:26 AM
Yesterday at 08:40 AM Erwin said this in Post #2 (https://vborg.vbsupport.ru/showthread.php?postid=422374#post422374)
Put the .htaccess in the highest directory where you want to protect the files in that directory and its sub-directories - so put it in root if you want ALL subdirectories to be affected, or in /images if you want all subdirectories in /images to be affected.

Best to do this in SSH rather than FTP as some FTP programs cannot see .htaccess files.


I don't know how to do it in SSH. Can you please give me instructions on how to do it in SSH or tell me what FTP will see .htaccess files?

One last question that I have is, I have multiple domains also. I would like to put a .htaccess for each of my sites, but I want each site to be able to access the other sites images and if need be, post them on the other sites. But I don't want to allow any other sites besides the sites within my network to do this. Can somebody please help me with the .htaccess code so that I know how to add my other sites to the .htaccess?

Thanks for any help you can provide.

Gutspiller
08-06-2003, 02:14 AM
bump