Copied to clipboard

Flag this post as spam?

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


  • Garðar Þorsteinsson 118 posts 564 karma points
    Nov 04, 2013 @ 19:41
    Garðar Þorsteinsson
    0

    Url rewrite in Umbraco, exclude app_plugins folder

    Hi guys,

    I had another post here but it got removed by a spam filter :)

    Lee was helping me with a url rewrite that would change urls like this

    This has been accomplished but I have a MVC application inside app_plugins that this rewrite rule seems to be conflicting with.
    This is the rule :

     <add name="rewrite"
      virtualUrl="~/(.*)/([\w]*)"
      destinationUrl="~/$1/?queryString=$2"
      rewriteUrlParameter="IncludeQueryStringForRewrite"
      redirectMode="Permanent"
      ignoreCase="true" />
    Is there any way to exclude the app_plugins folder from the rule ? Or does anyone has good ideas to accomplish this ?

     

  • Amir Khan 1287 posts 2744 karma points
    Nov 04, 2013 @ 22:33
    Amir Khan
    0

    Does this help? This ignores some folders specifi to Umbraco and might be a good starting point for you.

     

    <add name="301RedirectDirUrls"
    redirectMode="Permanent"
    redirect="Application"
    ignoreCase="true"
    rewriteUrlParameter="IncludeQueryStringForRewrite"
    virtualUrl="^\/(?!(umbraco\/|data\/|install\/|usercontrols\/|umbraco_client\/))(.*)\.aspx"
    destinationUrl="$1/$2" />
  • Garðar Þorsteinsson 118 posts 564 karma points
    Nov 04, 2013 @ 22:44
    Garðar Þorsteinsson
    0

    Thank you Amir,

    I'm not sure how to use this, the plugin inside App_plugins is MVC project so it would not match aspx endings.

    There is specific Mvc routing for that application that urlrewriting.net seems to be overriding.

    Is there no way to tell urlrewriting.net to simply not proccess some directories ?

  • Amir Khan 1287 posts 2744 karma points
    Nov 04, 2013 @ 22:53
    Amir Khan
    0

    I think you'd do it like this:

    <add name="rewrite"
    virtualUrl="^\/(?!(umbraco))~/(.*)/([\w]*)"
    destinationUrl="~/$1/?queryString=$2"
    rewriteUrlParameter="IncludeQueryStringForRewrite"
    redirectMode="Permanent"
    ignoreCase="true" />

  • Garðar Þorsteinsson 118 posts 564 karma points
    Nov 04, 2013 @ 23:15
    Garðar Þorsteinsson
    0

    There seems to be some error in it, the rule is not hit.

    I'm really greatful for your help ! 

    If you have anymore ideas it would be appreciated !


  • Amir Khan 1287 posts 2744 karma points
    Nov 04, 2013 @ 23:17
    Amir Khan
    0

    Whoops, did you change "umbraco" to "app_data" when you applied the rule?

  • Amir Khan 1287 posts 2744 karma points
    Nov 04, 2013 @ 23:17
    Amir Khan
    0

    "app_plugins", sorry.

  • Garðar Þorsteinsson 118 posts 564 karma points
    Nov 04, 2013 @ 23:20
    Garðar Þorsteinsson
    0

    yes I did :)

    But what ever is written there the main rule does not fire "~/(.*)/([\w]*)"

    The app_plugins work, but not /x/x/?querystring=abc

Please Sign in or register to post replies

Write your reply to:

Draft