PDA

View Full Version : Disallow remote linking to attachment.php


ImportPassion
05-02-2005, 02:30 AM
I did a search and didn't come up with anything. I know this existed for vb2, but I don't think there is one for vb3, if there is, please post a link. BUt if there isn't, wondering if someone could take it on?

THanks,
D

Reeve of shinra
05-02-2005, 02:44 AM
Theres a way to do this with an htaccess file in your forums directory but im not sure of the details off hand.

mholtum
05-02-2005, 03:35 AM
I did a search and didn't come up with anything. I know this existed for vb2, but I don't think there is one for vb3, if there is, please post a link. BUt if there isn't, wondering if someone could take it on?

THanks,
D
Do you have cpanel for control of your site? If so you can use "Hot Link Protection" and have any image you like display when someone links to your pics.. With a little imagination, this can be quite funny...

anarchystar
05-02-2005, 03:50 AM
if you have .htaccess file control you can put the following lines in it:


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


This will allow only the domains listed to link to images on your site, notice that I have the line:

RewriteCond %{HTTP_REFERER} !^http://(forums\.)?yourdomain.com/.*$ [NC]

that is for the subdomain forums.yourdomain.com ... any subdomain you want to allow access to imgages must be listed as such also

I also allow search engine domains to link to my images fro cacheing of pages, but you don't have to. If you don't want search engines to cache pages, just remove those lines

and finally, the line:

RewriteRule \.(gif|jpg)$ - [F]

tells the script what kind of images to apply the rules to. you can also add .bmp's or .png's by adding a pipe and the new file extenstion like this:

RewriteRule \.(gif|jpg|png|bmp)$ - [F]

Protoman
05-02-2005, 02:05 PM
I have the same sort of problem with remote linking of image.php and attachment.php but I can't use htaccess

Is there a way to require a user to be logged in to see the image/attachments?

T3MEDIA
05-02-2005, 03:09 PM
if you have .htaccess file control you can put the following lines in it:


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


This will allow only the domains listed to link to images on your site, notice that I have the line:

RewriteCond %{HTTP_REFERER} !^http://(forums\.)?yourdomain.com/.*$ [NC]

that is for the subdomain forums.yourdomain.com ... any subdomain you want to allow access to imgages must be listed as such also

I also allow search engine domains to link to my images fro cacheing of pages, but you don't have to. If you don't want search engines to cache pages, just remove those lines

and finally, the line:

RewriteRule \.(gif|jpg)$ - [F]

tells the script what kind of images to apply the rules to. you can also add .bmp's or .png's by adding a pipe and the new file extenstion like this:

RewriteRule \.(gif|jpg|png|bmp)$ - [F]
NICE ACTION!!!!!

WetWired
05-02-2005, 04:34 PM
Yes, you can.

ImportPassion
05-03-2005, 02:28 AM
Ok, the htaccess does not work in this instance. These are php files. I use htaccess all over the place for images.

I don't want to deny guests access to attachments.

So, can anyone implement this?

ImportPassion
06-18-2005, 03:02 AM
last cry for help