Forum Moderators: phranque

Message Too Old, No Replies

.pdf rewrite with embedded pdf

         

Weblamer

2:00 pm on Jun 8, 2011 (gmt 0)

10+ Year Member



Hello, odd problem here.

I have people coming into my site directly to PDF files that google as indexed. Such as:

www.mysite.com/pdf/file.pdf

I wanted to write a wrapper in php so that when people come in, they will view the pdf in an embedded page with our header and footer on it.

Something like this:

www.mysite.com/page.php?pdf=file.pdf

this just takes the name of the file and embeds it on the page.

I then added this rewriterule:

Rewriterule(.+\-.pdf)$ /page.php?pdf=$1 [L]

Without the rewrite rule, the php page for embeding the PDF works fine, however when I turn it on, it no longer works.

Does the rewrite rule actually effect the link inside the page code? Such as:

<embed src = 'file.pdf' >

is that link to the file inside the code also being changed by the rewrite rule?

g1smd

6:57 pm on Jun 8, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I assume you have created an infinite loop.