hotlinking
Does anyone know how angelfire does this
for example if you go directly to
http://www.angelfire.com/ut/ace000/images/MP3Player.exe
and you are out of their domain
it brings you to another page which can display a banner then allows you to click on a link that you can use to download that file.
if anyone knows how to do this please post it here.
Thanks
http://www.hostvista.com
Get your free 50mb homepage
Maverick posted this at 15:25 — 1st July 2000.
They have: 334 posts
Joined: Dec 1999
One way to do it with mod_rewrite. In .htaccess you'd put something like:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://www.angelfire.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://angelfire.com/.*$ [NC]
RewriteRule .*\.exe$ download.php3
That would look at the HTTP_REFERER field of the requesting browser whenever a file with the .exe extension was requested. If it came from angelfire it would allow the request, otherwise it would forward to a page called download.php3. In download.php3 you could just add in a link to the originally requested file with something like <? echo $REQUEST_URI ?>
Angelfire probably uses a far more complicated system, but if you're looking to do something similar on your site, that's the way to go about it.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.