Forum Moderators: phranque

Message Too Old, No Replies

Mod Rewrite PDF

Need to know how I can redirect people who access pdf files drirectly

         

keevanm

3:07 pm on Jul 14, 2004 (gmt 0)

10+ Year Member



Hi,
Need to redirect people who try and directly access pdf files on our server to a html wrapper page which has 2 frames one at the top with navigation to the rest of our site and another to contain the PDF file.

eg. if someone visits the link

"www.ourdomain.com/file.pdf"

need to rewrite it to

"www.ourdomain.com/wrapper.php?filename=file.pdf"

Did manage to get something sort of working but it would always loop so you would end up with nested frame pages everytime the frames source was set to file.pdf it would rewrite to the php page. Not sure how to stop this.

Thanks in advance

jdMorgan

3:10 pm on Jul 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



keevanm,

Welcome to WebmasterWorld [webmasterworld.com]!

> Did manage to get something sort of working but it would always loop so you would end up with nested frame pages everytime the frames source was set to file.pdf it would rewrite to the php page. Not sure how to stop this.

To save a lot of time, guesswork, and errors, please post your code that looped.

Jim

keevanm

6:59 pm on Jul 14, 2004 (gmt 0)

10+ Year Member



Code I have already cobbled together

RewriteEngine On
RewriteRule /[a-zA-Z0-9]+\.(pdf)$ /wrapper.php?pdffile=$0 [R]