Copied to clipboard

Flag this post as spam?

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


  • Laurence Gillian 600 posts 1219 karma points
    Aug 08, 2016 @ 15:26
    Laurence Gillian
    0

    IIS URL Rewrite - For Missing Pages

    I'd like to redirect any missing pages to a new URL.

    Use case:

    Folder contains Products. When a product is no longer sold, we want to redirect traffic to the main Category page, so the visitor will see the wonderful new products.

    E.g.

    /product/the-old-product

    404, redirect to:

    /categories/new

    My rule looks like:

    <rule name="Missing product stopProcessing="true">
        <match url="^product/(.*)" />
        <conditions logicalGrouping="MatchAll">
           // rule to match missing Umbraco Nodes.
        </conditions>
        <action type="Redirect" 
                redirectType="Temporary"
                url="https://{HTTP_HOST}/categories/new"/
                appendQueryString="true" />
    </rule>
    

    This currently just redirects everything! Missing and Present pages!

    Any help much appreciated :-)

    Laurie

  • Nik 1593 posts 7151 karma points MVP 6x c-trib
    Aug 08, 2016 @ 15:35
    Nik
    0

    Hi Laurence,

    Have you considered using 301 Redirect which is an Umbraco package (I'm afraid I don't have the plugin link to hand)?

    Alternatively, you might want to use a URL Provider and Content handler combination to write something:

    http://24days.in/umbraco/2014/urlprovider-and-contentfinder/

    Not sure if either of those will do your job though.

Please Sign in or register to post replies

Write your reply to:

Draft