allowing additional querys to pass at the end of a rewrite

First, the rewrite rule I am using, that works, is as follows:

eg: www.website.com/Primary/Subpage.html
RewriteEngine On
RewriteRule ^([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+).html$ /page.php?D=$1&DP=$2&Account=Client

This creates www.website.com/page.php?D=Primary&DP=Subpage&Account=Client

Occasionally, there is an additional string, eg
www.website.com/Primary/Secondary.html?addition_1=blabla
www.website.com/Primary/Secondary.html?foo=blabla
www.website.com/Primary/Secondary.html?thisone=blabla&thatone=blabla

I have tried:
RewriteRule ^([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+).html?(.*)$ /page.php?D=$1&DP=$2&Account=Client&AdditionalString=$3
(... figuring I could break it up with explode.)
and
RewriteRule ^([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+).html?(.*)$ /page.php?D=$1&DP=$2&Account=Client&$3

This does not pass anything through, not AdditionalString, addition, foo, thisone, thatone.

Is there a rewrite that will allow "whatever" the query is after to be captured as a whole?

eg rewrite to: www.website.com/page.php?D=Primary&DP=Secondary&thisone=blabla&thatone=blabla... would be perfect

Thanks
amakaramAsked:
Who is Participating?
 
karlwilburCommented:
%{QUERY_STRING}

RewriteRule ^([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+).html?(.*)$ /page.php?D=$1&DP=$2&Account=Client&%{QUERY_STRING}
0
 
amakaramAuthor Commented:
Excellent!
Thanks!
0
 
karlwilburCommented:
Glad to help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.