View Full Version : Protect avatars and attachments using mod_rewrite
DenzoForums
04-22-2004, 04:21 PM
I posted this over at vbulletin.com also, but i got pointed to an old thread that didn't have a working answer.
http://www.vbulletin.com/forum/showthread.php?t=19021
Anybody here know how to do this with htaccess?
Thanks
Dave
DenzoForums
04-26-2004, 11:53 PM
Anybody??? I need some help with this..
Thanks
Dave
Liquid1ce
04-28-2004, 03:22 AM
make a file called .htaccess & add the following then upload to your root dir
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://ServerIP/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://ServerIP$ [NC]
RewriteCond %{HTTP_REFERER} !^http://YourSite.org/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://YourSite.org$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.YourSite.org/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.YourSite.org$ [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp|zip|rar|mpg|mp3)$ http://www.SomeOtherSite.org/Theif.gif [R,NC]
The RewriteRule Are the extensions you want protected
DenzoForums
04-28-2004, 01:28 PM
OK.. I will give it a whirl.. but how do i findmy ip address? My host seems to be sleeping at the wheel, and never answers my requests for help..
note to self: Must look into new hosting company.
Thanks Dave
Sketch
04-28-2004, 01:44 PM
Windows > Start > Run > cmd
ping www.yourdomain.com
DenzoForums
04-28-2004, 02:52 PM
Windows > Start > Run > cmd
ping www.yourdomain.com
Thanks for the ip..
.. now how do i test this to see if it works.
i tried place my url for image here? .. but this doens;t seem to work. I still see the picture..
EDIT - Also where am i putting this? I put it oin the root for my domain..
Thanks
Dave
DenzoForums
04-28-2004, 02:54 PM
http://www.denzoforums.com/forum/attachment.php?attachmentid=289
this is using the img tag.. it show as a link, instead of showing the image.. any reason?
1 more try..
http://www.denzoforums.com/forum/images/buttons/edit.gif
OK.. this is not working either then..
Liquid1ce
04-28-2004, 04:23 PM
have you set in admincp to allow the [ img ] tag ?
also http://www.bytenix.net Have VERY Cheap hosting if your after new hosting
DenzoForums
04-28-2004, 04:32 PM
have you set in admincp to allow the [ img ] tag ?
Why would this matter? I am trying to protect my images from hotlinking to someone elses websites. as you can see in the post above, i was able to display an image hosted on my site directly in the post above. The .htaccess mod doesn;t seem to be protecting my image.
Thanks
Dave
P.S. I will look at the host. Do you host there? Are they in the U.S? how's the support?
Liquid1ce
04-28-2004, 04:42 PM
RewriteEngine needs to be on
& you'll see the image as you have the cookie from your site-
As for the hosting yes im hosting there & support is very good
the servers are in the us yea
DenzoForums
04-28-2004, 04:51 PM
RewriteEngine needs to be on
& you'll see the image as you have the cookie from your site-
As for the hosting yes im hosting there & support is very good
the servers are in the us yea
ok.. do you see the image above? the edit image a few posts above?
doesn;t the .htaccess file add rewriteengineon?
Thanks
Dave
Liquid1ce
04-28-2004, 04:57 PM
no RewriteEngine needs to be added or commented out in the apache httpd.conf
& yeah i see the file-
The host i use bytenix.net auto protect your imgs from hotlinking
DenzoForums
04-28-2004, 04:58 PM
no RewriteEngine needs to be added or commented out in the apache httpd.conf
& yeah i see the file-
The host i use bytenix.net auto protect your imgs from hotlinking
ok.. that's my problem.. i can't edit my httpd.conf file.. thus partly why looking for new host..
Thanks!
DenzoForums
04-28-2004, 05:35 PM
thanks for the tip of the host.. I just had a look and a chat.. Also a demo of the cpanel admin area..
I am switching to them as we speak..
Thanks again!!
Dave
Maikel
04-29-2004, 08:20 AM
i use this one
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://YOURDOMAIN.COM.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.YOURDOMAIN.COM.*$ [NC]
RewriteRule /* http://www.YOURDOMAIN.COM/stolen.jpg [R,L]
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.