« Previous Next »

Thread: QSA being applied by default when importing from mod_rewrite

Last post 06-11-2008 8:09 PM by Jason Hill. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 06-11-2008, 6:21 PM

    • Jason Hill
    • Top 200 Contributor
    • Joined on 04-22-2006, 11:39 PM
    • Sydney, Australia
    • Posts 26

    QSA being applied by default when importing from mod_rewrite

    Hi,

    After importing a set of rules, some of them have no appendQueryString attribute and yet the UI in IIS7 shows appendQueryString="true". These rules did not have QSA so I would have expected to see appendQueryString="false" being applied for them. Is that right?

    Jason

  • 06-11-2008, 8:00 PM In reply to

    • ruslany
    • Top 25 Contributor
    • Joined on 07-01-2007, 7:38 PM
    • Redmond, WA
    • Posts 661

    Re: QSA being applied by default when importing from mod_rewrite

    The reason why the appendQueryString is set to true is because its semantics in IIS is somewhat different from QSA in mod_rewrite.

    In mod_rewrite if substitution string does not contain query string then the original query string is preserved regardless of QSA flag. For example this rewrite rule:

    rewriterule a b

    will replace "a?c=1" to "b?c=1".

    In IIS URL rewriter if appendQueryString is set to false then it means that original query string will never be preserved. For example this rewrite rule:

    <rule>    <match pattern=”a”>    <action type=“Rewrite” url=”b” appendQueryString=”false” /></rule>

    will replace "a?c=1" to "b". Notice that the original query string will be dropped.

    So in order to get the exact same behavior of the converted mod_rewrite rule in IIS the rule importer tool sets this flag to true if the substitution url in mod_rewrite rule did not have the query string.

    http://ruslany.net
  • 06-11-2008, 8:09 PM In reply to

    • Jason Hill
    • Top 200 Contributor
    • Joined on 04-22-2006, 11:39 PM
    • Sydney, Australia
    • Posts 26

    Re: QSA being applied by default when importing from mod_rewrite

    Cool...thanks for clarifying.

Page 1 of 1 (3 items)
Microsoft Communities