Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
355 views
in Q2A Core by

I've tried everything but just can't seem to get things right :( I have over 800 urls and I need to rewrite them to point to a simple pdf file. I have links to:

http://subdomain.mydomain.com/?type=pdf&id=id123
http://subdomain.mydomain.com/?type=epub&id=id123

and I need this :

http://subdomain.mydomain.com/pdf/id123.pdf
http://subdomain.mydomain.com/epub/id123.epub

I've read through the Reference pages but I am still missing something. I can't remove the end string (?type=pdf&id=id123)

RewriteCond %{QUERY_STRING} ^type=pdf&id=(.*)$
RewriteRule /?$ pdf/%1.pdf

Outputs:

http://subdomain.mydomain.com/pdf/id1234.pdf?type=pdf&id=id123

I can't get rid of ?type=pdf&id=id123 at the end

Please log in or register to answer this question.

...