locked
Rules stopped processing RRS feed

  • Question

  • User-1819217823 posted

    I download and installed rewrite_2.0_x64_beta.msi yesterday, July 30. While trying to get a site working on IIS 7 I uninstalled the tool as I wasn’t sure if that was the issue, turned out not to be the issue. However, now that I have re-installed the tool I am unable to get the rules to process again. I’ve followed the steps here:

    <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p> </o:p>

    http://learn.iis.net/page.aspx/461/creating-rewrite-rules-for-the-url-rewrite-module/

    <o:p> </o:p>

    which worked when I first installed the tool. I also created my own rule that was setup as follows:

    Machine Node

                    Started with blank rule

                    Name = test

                    Request URL= matches the pattern

                    Using = Wild Cards

                    Pattern = *

                    Ignore case = true

                    No conditions defined

                    Action Type = None

                    Server Variables = Test1/Test2

                    Stop Processing of subsequent rules = false

    As with the getting started tutorial this worked great yesterday even for my classic asp pages, which is what I really needed it for.

    <o:p> </o:p>

    However, today it’s not working after uninstalling/reinstalling. I’m not quite sure where to look to verify that the reinstall worked correctly, so any help would be appreciated.

    Thanks

    Wayne

    Friday, July 31, 2009 3:44 PM

Answers

  • User-1637866776 posted

    When you use an iterator in ASP such as "for each name in request.servervariables" it will not print the value of the custom server variables that you have set. Can you try accessing the server variable directly by name from the ASP code, e.g.:

    <%= request.servervariables("MYSERVERVAR") %>

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Monday, August 3, 2009 6:47 PM

All replies

  • User-1637866776 posted

    By "not working" do you mean the rules are not executed or the error is returned when you make a web request? Can you provide more details on that?

    Friday, July 31, 2009 3:52 PM
  • User-1819217823 posted

    Sorry about that I try my best to give as much info as possible.


    By not working I mean not executed. There are no errors, the pages work just as if the module isn't installed. The classic ASP page I have simply writes out the server variables on the page and I don't see my the test vars on the page.

    Friday, July 31, 2009 8:27 PM
  • User-1819217823 posted

    I have verified that the module is installed and being used, I changed the Match URL Using to Regular Expressions and gave it an invalid expression, at which point all sites on the machine started returning 500 errors with text about the expression being invalid.

    Adding a server var that already exists and telling it to replace it with my own text works, but the new vars are not getting added to the list. However, this did work on the first install.

    After more testing it appears that the module is working, and I see ALL my server vars in the raw view, but I don't see the Test2 one I created in the list.

    Either way it appears my issue with this wasn't really an issue, still odd I don't see the on in the list though, but I'm not great at classic ASP so I may have messed that up.

    Monday, August 3, 2009 8:21 AM
  • User-1637866776 posted

    When you use an iterator in ASP such as "for each name in request.servervariables" it will not print the value of the custom server variables that you have set. Can you try accessing the server variable directly by name from the ASP code, e.g.:

    <%= request.servervariables("MYSERVERVAR") %>

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Monday, August 3, 2009 6:47 PM
  • User-1819217823 posted
    Sorry about the delay, I've gotten side tracked on other items. This is what I've done:

    I created the following Rule:

    <rule name="TestRule" patternSyntax="Wildcard" stopProcessing="false">
    <
    match url="*" ignoreCase="true" negate="false" />
    <
    conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
    <
    serverVariables>
    <
    set name="TestParam" value="TestValue" replace="false" />
    <
    set name="TestParam2" value="TestValue2" replace="true" />
    <
    set name="HTTP_UA_CPU" value="My CPU Value" replace="true" />
    </
    serverVariables>
    <
    action type="None" appendQueryString="true" redirectType="Temporary" />
    </
    rule>



    Using the Code found at the following link I created a page to list out the sever vars:
    http://www.earthskater.net/devzone/aspservervariables.asp

    To the bottom of the Table I added:

    <tr><td>
    <
    font face="Arial" size="1"><%= request.servervariables("TestParam") %></font>
    </
    td></tr>
    <
    tr><td>
    <
    font face="Arial" size="1"><%= request.servervariables("HTTP_UA_CPU") %></font>
    </
    td></tr>

     

    I see the My CPU Value both in the line I added and as the last Sever var in the list outputted by the loop, but I don't see either fo the TEST Params/Values.

    I added the rule to the SITES node.

    Any additional direction would be great.

    Thanks
    Wayne

    Monday, August 31, 2009 4:35 PM
  • User-1480425032 posted

    This is not a rewrite issue.

    In fact, the classic asp changes server variable name to upper case and queries.

    The workaround is to set server variable name with upper cases.

    Ex)

    <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p><serverVariables><o:p></o:p>                            <set name="TESTPARAM" value="TestValue" replace="false" /><o:p></o:p>                            <set name="TESTPARAM2" value="TestValue2" replace="true" /><o:p></o:p>                            <set name="HTTP_UA_CPU" value="My CPU Value" replace="true" /></serverVariables><o:p></o:p>

    Thanks.

    Friday, September 4, 2009 12:43 PM
  • User-1819217823 posted

    Ok, so I made it all CAPS and it appears now when I reference the server var directly. Thank you.

    Why wouldn't it show in the list though? Are they not the same lists?

    Monday, September 14, 2009 3:00 PM
  • User511787461 posted

    The problem is that IIS treats server-variable names as case-sensitive while asp treats them as case-insensitive, this means that any server-variable which is not all-caps cannot be retrieved from asp.

    Monday, September 14, 2009 3:56 PM
  • User-1819217823 posted

    I understand now the issue with the case sensitive issue, and have gotten past that. However, I must STILL reference the server var directly by name, it doesn't show up in the LIST that is created from the code in the link I put in a few posts above.

    I am wondering why it's not showing in the list even though I am able to access it by name.

    Monday, September 14, 2009 11:14 PM