Copied to clipboard

Flag this post as spam?

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


  • Deepali Bhola 23 posts 43 karma points
    Aug 13, 2012 @ 15:26
    Deepali Bhola
    0

    url rewriting not working for me..

    Hello,

    i have add this rule to  config/UrlRewriting

     <add name="LatestNewsIdRewrite" virtualUrl="^~/latestnews/(.*).aspx"
            rewriteUrlParameter="ExcludeFromClientQueryString"
            destinationUrl="~/{localLink:1178}?LatestNewsId=$1" ignoreCase="true" />
    {localLink:1178} is my latestnews.aspx page ID

    i want

    http://localhost/umbracoweb/home/latestnews/225.aspx

    to http://localhost/umbracoweb/home/latestnews.aspx?LatestNewsId=225

    but it is showing me the same url http://localhost/umbracoweb/home/latestnews.aspx?LatestNewsId=225

    in web.config     <add key="umbracoHideTopLevelNodeFromPath" value="false" />

    What i am missing here

    plz help!!


  • Deepali Bhola 23 posts 43 karma points
    Aug 13, 2012 @ 17:41
    Deepali Bhola
    0

    Can any one reply to my query...

  • Deepali Bhola 23 posts 43 karma points
    Aug 14, 2012 @ 09:35
    Deepali Bhola
    0

    Can any one have any idea abt this issue??

    or i have asked something wrong..

  • Deepali Bhola 23 posts 43 karma points
    Aug 14, 2012 @ 15:24
    Deepali Bhola
    0

    if any admin is seeing this post plz guide...

  • Rob Walker 13 posts 34 karma points
    Aug 14, 2012 @ 15:40
    Rob Walker
    0

    Its your regex on the virtual path from what I can see.  Your rule is saying it starts with latestnews but your path is /umbracoweb/home/latestnews.  I think (although I suck at regex) the rule should therefore be:

    <add name="LatestNewsIdRewrite" virtualUrl="(.*)/latestnews/(.*).aspx" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/{localLink:1178}?LatestNewsId=$1" ignoreCase="true" />

    ttfn,

    Rob

     

  • Deepali Bhola 23 posts 43 karma points
    Aug 14, 2012 @ 16:25
    Deepali Bhola
    0

    Thanks Rob for reply..

    if i write like below then it works :

        <add name="LatestNewsIdRewrite"
          virtualUrl="home/latestnews/(.*).aspx"
          rewriteUrlParameter="ExcludeFromClientQueryString"
          destinationUrl="home/latestnews.aspx?LatestNewsId=$1"
          ignoreCase="true" />

    Is it ok to write like this or any kind of issue can raise in futute.

    Pls Guide.

    Thanks.

  • Rob Walker 13 posts 34 karma points
    Aug 14, 2012 @ 16:27
    Rob Walker
    0

    No worries Deepali - its fine to write it like that as long as your not planning on changing the content structure (ie moving the location of latest news).

    Cheers,

    Rob

Please Sign in or register to post replies

Write your reply to:

Draft