Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • A Riley 4 posts 24 karma points
    Feb 27, 2012 @ 04:21
    A Riley
    0

    Url Rewrite not working in Umbraco 4.7 & local IIS 7.5

    Not having any luck getting the builtin url rewriting to work, as in the product page is not redirected or rewritten. Here's is my current setup with a local `redesign.website.local` website. Any pointers?

     

    1. change -    <add key="umbracoUseDirectoryUrls" value="true" />

    2. confirm -    <modules runAllManagedModulesForAllRequests="true">

    3. add attribute preCondition -      <add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule,

    UrlRewritingNet.UrlRewriter" preCondition="" />

    4. updated config/UrlRewriting.config -
    <urlrewritingnet rewriteOnlyVirtualUrls="true"
        contextItemsPrefix="QueryString"
        defaultPage = "default.aspx"
        defaultProvider="RegEx"
        xmlns="http://www.urlrewriting.net/schemas/config/2006/07">
        <rewrites>

            <add name="ProductPageRewrite"
               virtualUrl="^~/product/d/(.*).aspx"
               rewriteUrlParameter="ExcludeFromClientQueryString"
               destinationUrl="~/products/detail.aspx?id=$1"
               ignoreCase="true" />
        </rewrites>
    </urlrewritingnet>

  • A Riley 4 posts 24 karma points
    Feb 29, 2012 @ 16:33
    A Riley
    0

    Any suggestions?

  • Tony Bolton 83 posts 109 karma points
    Mar 13, 2012 @ 12:40
    Tony Bolton
    0

    Hi mate,

    It might be that you need to enable wildcard mapping for the isapi .net assembly.  I had the same problem a while back in IIS 6 and it was just a case of doing that.

    Go into Mappings and add the path c:\windows\microsoft.net\framework\v4.0.30319\aspnet_isapi.dll, and make sure that the tickbox for 'Verify that the file exists' is turned off.  That should sort it out :)

    Let me know how you get on,

    Cheers,

    Tony

  • A Riley 4 posts 24 karma points
    Mar 14, 2012 @ 04:07
    A Riley
    0

    Thanks Tony! I was unable to get the URL Rewriting to work on a default install of IIS 7 so I instead went with URL Routing based roughly on http://weblogs.asp.net/scottgu/archive/2009/10/13/url-routing-with-asp-net-4-web-forms-vs-2010-and-net-4-0-series.aspx . The way that works is you set up a virtual route and redirect out to a page and instead of using the querystring for your vars you use the route data values. In 4.0 the custom http route handlers are no longer needed. the only downside of this approach is that you have to create an actual aspx page to handle the request, which meant recreating the page outside of the CMS and adding the macros into the page dynamically. If there is a better approach on IIS 7 I'd be happy to try for either approaches.

  • David Verberckmoes 46 posts 77 karma points
    Mar 15, 2012 @ 16:01
    David Verberckmoes
    0

    Hi,

    as you set umbracoUseDirectoryUrls to true I guess you don't need the .aspx extension in the virtualUrl and destinationUrl of the rewrite rule.

    Rgds

    David

Please Sign in or register to post replies

Write your reply to:

Draft