1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

URL Rewriter Redirect question.

Discussion in 'Off Topic' started by rEd86, Mar 13, 2011.

  1. rEd86

    rEd86 Active Member

    Greetings.

    This is a more general programming question. I need to redirect queries coming into my server from:

    http://pdf.servername.com/filename.pdf

    to

    http://pdf.servername.com/pdf.php?id=filename

    so that my code can generate a PDF on the fly. My redirect skills are pretty rusty so I was hoping some expert out there could refresh my memory and save what little hair I have left... Here's what I tried:

    Code:
    RewriteRule ^(/*)(.pdf)$ [URL]http://%1/pdf.php?id=$1[/URL] [NC,R=301]
    Thanks!

    --Ed
     

Share This Page