Property in Dubai - Debt Consolidation - IKA Processing Equipment - Credit Card - Bad Credit Loans

PDA

View Full Version : Redirect from image files


degy
Jan 2nd 2007, 11:09 am
Hy
i'm looking for a way to redirect to same page every time anyone wants to access specific image (example.gif for example :P ). Something like scipts for preventing hotlinking. But for only one image. I can't use .htaccess becouse godaddy doesn't support it.

Is this even possible?

ZareMedia
Jan 2nd 2007, 2:48 pm
Without .htaccess or some apache configuration changes, no. An image request hits your webserver directly and this never comes into play with PHP.

degy
Jan 2nd 2007, 3:03 pm
ok i did it with .htaccess is there any way to know which image was hotlinked? $_SERVER["HTTP_REFERER"] doesn't work. And again, is this even possible :)

ZareMedia
Jan 2nd 2007, 3:09 pm
What method exactly are you employing for hotlink prevention?

degy
Jan 3rd 2007, 12:56 am
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?beautiesdb\.org/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif|bmp|png)$ redirect.php [L]
Exactly this :D well i read that it's only safe to redirect to files with same extention as the one hotlinked but this works for me

rodney88
Jan 3rd 2007, 3:55 am
I can't see why it would ever be unsafe to redirect to different file extensions.. that would kinda limit the main uses of mod_rewrite.

degy, HTTP_REFERER will give you the referring page, i.e. the page that the image was linked from. Try REQUEST_URI instead..