Hello, I was wondering if it was possible to make for example: http://www.domain.com/images/image.jpg go to http://www.domain.com/image.php?id=image.jpg I saw something like this on the forum: If (request full_image AND TYPE =IMAGE) THEN REDIRECT TO image.php?id=requested_file. Code (markup): But that won't work. So if someone has any suggestions, i'm all ears (eyes ) Thanks a lot in advance And i did try searching google already, but that just gave me the hotlink prevention i already knew.
You can use a rewrite rule such as this: RewriteRule ^/(*.jpg) http://www.domain.com/image.php?id=$1 Code (markup):
Hey, thanks for the reply. I did try that: RewriteRule ^/(*.jpg) http://www.sipifi.com/image.php?id=$1 Code (markup): That gives me an internal server error. I have that .htacces file in the images folder and here's the .htacces: <IfModule mod_rewrite.c> AddHandler cgi-script .php .php3 .php4 .phtml .pl .py .jsp .asp .htm .shtml .sh .cgi .htaccess Options -ExecCGI RewriteRule ^/(*.jpg) http://www.sipifi.com/image.php?id=$1 </IfModule> Code (markup):
I know it hasn't been long since i started this, but does anyone have an idea? i tried some others too, same result. I tried putting a shtml file in the image dir <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Sipifi.com image</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> @import url(/css/common/); </style> </head> <body> <p align="center"><img src="<!--#echo var="query_string" -->" alt=""></p> <p align="center">This image is from Sipifi, <a href="www.sipifi.com" title="Home page of Sipifi.com">sipifi.com</a>.<br> Feel free to look around the site.</p> <p align="center">The permanent link to this image is:<br> <a href="http://www.sipifi.com<!--#echo var="query_string" -->" title="Use this URL for linking or bookmarking" class="small-text">http://www.sipifi.com <!--#echo var="query_string" --></a></p> </body> </html> HTML: And in the .htacces file would be: RewriteCond %{REQUEST_FILENAME} \.(gif|jpe?g|png)$ [NC] RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !sipifi\.com [NC] RewriteCond %{HTTP_REFERER} !apifi\.com [NC] RewriteCond %{HTTP_REFERER} !google\. [NC] RewriteCond %{HTTP_REFERER} !search\?q=cache [NC] RewriteRule (.*) /view_image.shtml?/$1 [R,NC,L] Code (markup): After doign this i didn't even get a internal server error. Hotlinking would still work on any site.