« Previous Next »

Thread: It used to work...

Last post 11-17-2008 5:00 PM by CrispinH. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 11-17-2008, 12:16 PM

    • CrispinH
    • Top 500 Contributor
    • Joined on 09-17-2008, 11:10 AM
    • Posts 23

    It used to work...

    I have been using the Microsoft x64 URL Rewrite Module for some weeks on my development computer successfully with the configuration:

    <rewrite>
    <
    rules>
    <
    rule name="Catalogue">
    <
    match url="/([0-9]+)/catalogue.aspx" />
    <
    action type="Rewrite" url="/c/catalogue.aspx?wid={R:1}" appendQueryString="false" />
    </
    rule>
    </
    rules>
    </
    rewrite>

    Today I had occasion to make a change to this rule but reverted it, but now I'm getting an error:

    The expression "/catalogue.aspx?wid={R:1}" cannot be expanded.

    I'm not sure what that means - anyone any idea. I subsequentlyl scoured the net for solutions and noticed that there was a more recent release (10 Nov 2008) of the URL Rewrite Module, so I installed that.

    As an experiment I changed the target to a page called blah.aspx (which did exist) ie:

    <action type="Rewrite" url="/c/catalogue.aspx?wid={R:1}" appendQueryString="false" />

    but the same error message (note with catalogue.aspx and not blah.aspx in it) so I suspected some kind of cache issue.  I noticed that you could add a registry key to diable internal caching of rewrite rules:

    reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp\Rewrite /v RewriteCacheEnabled /t REG_DWORD /d 0

    though maybe this would be undesirable on a production machine.  However since this is a development box, I applied it, ran iisreset and recycled the application pool for good measure, but it made no difference to the problem.

    This leads to a side question: rather than disable the rewrite cache, is there a way of flushing it?

    I then went to the Output Caching section of the website and then Edit Feature Settings and turned off both the cache and the kernel cache.  Neither of them made any difference, so I turned them back on.

    Can anyone give me any clues as to how to fix this?

    TIA

     Crispin

  • 11-17-2008, 1:44 PM In reply to

    • DanielVL
    • Top 75 Contributor
    • Joined on 10-07-2006, 6:00 PM
    • Redmond, WA, USA
    • Posts 109

    Re: It used to work...

    Hi Crispin,

    You shouldn't need to disable the internal rewrite cache in the latest release, perhaps you installed the latest version and you had a worker process (w3wp.exe) still running with the previous version.

    The best way you can figure out what is going on is by enabling FRT (FREB), please read the following article that explains you how to enable it:

    http://learn.iis.net/page.aspx/467/using-failed-request-tracing-to-trace-rewrite-rules/

    Output user caching and kernel caching are not related to the "The expression X cannot be expanded", so don't change the configuration.

    Thanks.

    Daniel Vasquez Lopez
    URL Rewrite Engine Developer
  • 11-17-2008, 5:00 PM In reply to

    • CrispinH
    • Top 500 Contributor
    • Joined on 09-17-2008, 11:10 AM
    • Posts 23

    Re: It used to work...

    Daniel

    Thanks for your reply.  You set me on the path to working out what was (not) going on.  When I tried to create a rule in the Failed Request Tracing dialogue, the Rewrite option under WWW Server was absent.  I guessed that by installing the new version of the Rewrite Module over the top of the old one, something had gone wrong.  So then removed the installation, rebooted (although it wasn't required) and then re-installed the November 2008 release.  Now it works fine.

    Regards

    Crispin

Page 1 of 1 (3 items)
Microsoft Communities