Jump to content

Hot Link Image Viewer


ciber

Recommended Posts

Hi,

 

I have a big issue with my site, what is happening is im getting close to 3000 links to my images from forums and site - problem is I want the people to be able to view it from my site but i dont want it to be viewable on the site.

 

I tried playing around with some PHP as I wanted to get it to make the image viewable through php.

 

My idea was to take the source url and place it into an <img src=" "> but I dont know how to do the htaccess to work so that the image url and what should be put inbetween the " " to get the link there.

 

Does anyone know if this is possible? if so how can I do it then?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/112015-hot-link-image-viewer/
Share on other sites

put this in a your .htaccess file of the directory that your images reside:

.htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://([^.]+\.)?domain\.com/ [NC]
RewriteCond %{HTTP_USER_AGENT} !(googlebot-image|msnbot|psbot|yahoo-mmcrawler) [NC]
RewriteRule \.(bmp|gif|jpe?g|png)$ - [NC,F]
</IfModule>

 

Ive done that already,

 

What is happening now is

 

User visits from other site > htaccess blocks user > redirects to page saying "no access

 

what i want it to do is,

 

User visits from other site > user gets redirected to viewing page > image viewable

I want to use it so that they get re-directed to a page where the image is viewed, so that I can at least track the hits and the image is not being viewed without the sites borders around it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.