Forum Moderators: phranque

Message Too Old, No Replies

Redirecting requests

How to redirect requests through .php file...

         

TomteFar

6:21 pm on Feb 12, 2004 (gmt 0)

10+ Year Member



I need a nice little set of rules too disable hotlinking of files from my website, ive been sitting here reading tons of information about mod_rewrite but for some reason i cant get it right!

This is how it is:
Ive got a downloadscript that counts downloads, referrer and theoretical bandwidth usage. But, this script needs to called by [mysite.com...] , this means that the file also can be downloaded from [mysite.com...] but then it wont get counted.

Well, can someone give me some guidance howto write in my .htaccess file?

This is as far as this day have taken me:

jdMorgan

6:50 am on Feb 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



TomteFar,

Welcome to WebmasterWorld [webmasterworld.com]!

Post your code, and we'll try to help. Or this Introduction to mod_rewrite [webmasterworld.com] thread might help get you started.

Jim

TomteFar

11:05 am on Feb 15, 2004 (gmt 0)

10+ Year Member



Oopps... sorry, forgot to post the code!

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule download.php - [L]
RewriteRule /(.+\..+)$ download.php?file=$1 [L]