Copied to clipboard

Flag this post as spam?

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


  • Zagreus 2 posts 22 karma points
    May 18, 2011 @ 01:30
    Zagreus
    0

    Hijack URL Rewrite before error 404

    Hi 1st Post, I'm at version 4.5

    Say I had url:
    http://server/home/fist.aspx

    But I move the object for some organization reasons
    http://server/home/new/fist.aspx

    So I would like to capture the URL in some CS file before getting 404 file or automatic redirect, do all rewrite all by myself and do the redirect my way.

     

    Any Ideas?

  • Gene Foxwell 17 posts 39 karma points
    May 18, 2011 @ 14:00
    Gene Foxwell
    0

    I any reason why you can't use the built in UrlRewriter functionality that comes with Umbraco by simply adding a new rule to the UrlRewriting.config file in the config folder of umbraco to do what you are looking for?  Say:

     

    <add name="myRewrite"   virtualUrl="~/home/first.aspx" 
    rewriteUrlParameter="ExcludeFromClientQueryString"
      destinationUrl="~/home/new/first.aspx" 
    ignoreCase="true" />

    That would seem like best practice to me as it uses functionality alright built into Umbraco for this purpose - doing it another way would risk putting you at odds wit the existing tools.

     

  • Zagreus 2 posts 22 karma points
    May 18, 2011 @ 16:24
    Zagreus
    0

    the problem is that I have thousands of old URLs

    so would be cool to grab and replace some strings

Please Sign in or register to post replies

Write your reply to:

Draft