Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
06-12-2013, 02:28 PM #1
- Join Date
- May 2007
- Thanked 0 Times in 0 Posts
htaccess redirect incoming traffic from external websites
I have a server i am using to host a bunch of zip files download
A lot of websites have been putting direct links to my zip files. I'm trying to find a way to redirect all incoming trafic from external websites because i want to put a page to display a message before users can download the file.
So let's say the file is www.mydomain.com/somefile.zip If someone try to access this file from an external domain, i would want to redirect them to www.mydomain.com/download.php?file=somefile.zip
In other words, it should be impossible to download the .zip file except if you are being redirected from www.mydomain.com/download.php
Download.php will display some message with a link to download the file. So the htaccess must only redirect the trafic coming from other domains. If the user try to access somefile.zip from www.mydomain.com then he must not be redirected or else it will fall in a loop.