Copied to clipboard

Flag this post as spam?

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


  • Dennis 33 posts 238 karma points
    Nov 12, 2015 @ 13:52
    Dennis
    0

    UrlRewriting.config Single Page Application

    Hi I have a problem getting UrlRewriting to work for my single page application.

    I use the following:

    <add name="SPA"
         virtualUrl="^~/(?![0-9]+/)(?!umbraco/)([^\?]*?)$"
         rewriteUrlParameter="ExcludeFromClientQueryString"
         destinationUrl="~/"
         ignoreCase="true" />
    

    The problem now is I redirect all to AngularJS, but now I can't access Umbraco. Does anyone know how I can redirect all to AngularJS except /Umbraco ?

  • Dennis 33 posts 238 karma points
    Nov 16, 2015 @ 12:34
    Dennis
    100

    I've found that the solution was easier than it looked. Think regular expressions always is like that.The regular expression says: "From the start of the string after the base Url (~) exclude umbraco and ucommerce and uCommerce, the rest goes to base url.

    Here's my solution:

    <add name="Eventcatering"
     virtualUrl="^~/(?!umbraco|ucommerce|uCommerce)(.*)"
     rewriteUrlParameter="ExcludeFromClientQueryString"
     destinationUrl="~/"
     ignoreCase="true" />
    

    I use the uCommerce package as well, which have some control API in /ucommerce, so these need to be excluded too.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies