allowing additional querys to pass at the end of a rewrite

Posted on 2007-10-15
Last Modified: 2010-03-04
First, the rewrite rule I am using, that works, is as follows:

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

This creates

Occasionally, there is an additional string, eg

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.)
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: would be perfect

Question by:amakaram
    LVL 6

    Accepted Solution


    RewriteRule ^([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+).html?(.*)$ /page.php?D=$1&DP=$2&Account=Client&%{QUERY_STRING}

    Author Comment

    LVL 6

    Expert Comment

    Glad to help.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Suggested Solutions

    Title # Comments Views Activity
    Leverage Browser Caching 7 50
    XAMPP 14 33
    instanceof  operator in java 26 54
    PHP Register global 21 59
    If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
    It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now