Copied to clipboard

Flag this post as spam?

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


  • Simon 81 posts 184 karma points
    Oct 03, 2012 @ 12:07
    Simon
    0

    Problem with URL re-writing

    Hi,

    So I had a page called "Where to go when" that used to live at www.example.com/where-to-go-then that page for various reasons has now been renamed holiday-calendar and lives at www.example.com/holiday-calendar

    I've set up a rule in UrlRewriting.config that looks like this:

    <add name="WhereToGoWhen"
      rewrite="Application"
      virtualUrl="^~/where-to-go-when"
      redirectMode="Permanent"
    rewriteUrlParameter="IncludeQueryStringForRewrite"
    destinationUrl="~/holiday-calendar"
    ignoreCase="true" />

    The problem is that if you go to the old Url, the old Url serves up the new content - it doesn't "bounce" the visitor to the new Url. As it stands - with the new Url, there is duplicate content on the site and that's bad!

    Umbraco version 4.7.1.

    Any ideas much appreciated.

    Cheers

    Simon

  • Niels Lynggaard 193 posts 551 karma points
    Oct 03, 2012 @ 13:42
    Niels Lynggaard
    0

    Hi Simon

    Here's an example of my redirects that work like a charm. It sends 302 to the visitor and redirects :)

    <add name="com_help_category_1" virtualUrl="~/flight_info/help_centre/questions_and_answers/\?news_category_id=8" rewriteUrlParameter="IncludeQueryStringForRewrite" redirect="Application" redirectMode="Permanent" destinationUrl="~/flights/help-centre/questions-and-answers/Children-and-Pregnant-Women.aspx" ignoreCase="true"/>

    Maybe you need redirect="Application"?

    Cheers,

    NileZ

     

     

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Oct 03, 2012 @ 13:47
    Stefan Kip
    0

    Also this package is really helpful for this sort of things.

  • Simon 81 posts 184 karma points
    Oct 03, 2012 @ 13:54
    Simon
    0

    Thanks a lot for the responses - as per usual the problem was between the keyboard and the chair!

    The syntax is redirect="Application" NOT rewrite="application" that I'd been using.

    Have ammended and everything's working fine now.

    Cheers

    Simon

  • 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