|
|
| Welcome to the Mac Forums forums. Please read the FAQ if you have questions. Register to participate. |
|
|||||||
| TouchArcade.com - iPhone Game Reviews and News |
![]() |
|
|
Thread Tools | Search this Thread |
|
|
|
|
#1 |
|
macrumors 601
Join Date: Aug 2005
Location: Dayton, OH
|
Redirect hotlink of PDF files
I've modified my .htaccess to redirect hotlinking of images from my site, and I wanted to do something similar with PDF files. In essence when a link comes from outside my site trying to access a PDF file, I want them redirected to a certain page on my site. Currently I have this:
Code:
### Incoming links to PDF files get redirected to publications page
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$ # blank referrer OK
RewriteCond %{HTTP_REFERER} !mysite\.com [NC] # from ymsite OK
RewriteRule ^.*/articles/.*\.pdf$ /publications.php [R]
If you have an idea of how to resolve the above, or know of a better technique to do what I'm wanting let me know. |
|
|
|
|
|
#2 |
|
Thread Starter
macrumors 601
Join Date: Aug 2005
Location: Dayton, OH
|
It was a slow weekend so just want to make sure people saw this post. I haven't resolved it as of yet.
|
|
|
|
|
|
#3 |
|
macrumors 6502
Join Date: Oct 2007
|
i did some looking around and a list apart looks like they have a good solution for your problem. you could just alter it to redirect to a page.
check it out here. |
|
|
|
|
|
#4 | |
|
Thread Starter
macrumors 601
Join Date: Aug 2005
Location: Dayton, OH
|
Quote:
|
|
|
|
|
|
|
#5 |
|
macrumors 6502
Join Date: Oct 2007
|
just curious if you ever found a solution?
after haven't looked, all i find are image hotlink preventions. no file other files types. |
|
|
|
|
|
#6 | |
|
Thread Starter
macrumors 601
Join Date: Aug 2005
Location: Dayton, OH
|
Quote:
Why the hotlinking block wasn't working is still bugging me. Not sure if it's a binary file issue, or if its because the PDF has to be loaded through a plug-in and that somehow interrupts information flow between the server redirect and the browser somehow. Thought about testing it out by placing a Windows executable out there and doing a hotlink block on it, but haven't gotten around to it. I could also try with a movie file since those work through plug-ins as well. |
|
|
|
|
|
|
#7 | |
|
macrumors 601
Join Date: Jan 2006
Location: Redondo Beach, California
|
Quote:
Then on your publications web page you replace your links with a link to a cgibin file that is passed the filename as input and writes the un-encrypted file to standard out. You don't even need a strong encryption. Any hack will be good enough. |
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|