x First time here? Check out the FAQ
Join us a the Umbraco event of the year - get your Codegarden 14 early bird ticket today

Add an Url Rewrite rule

    This Package action will Add a new url rewriting rule to the UrlRewriting.config file. The undo option makes sure that the rewriting rule can be removed again at uninstall.

    Alias: AddUrlRewriteRule

    <Action runat="install" 
    undo="true/false"
    alias="AddUrlRewriteRule">
    <add name="CWS_emaiAFriendID"
    virtualUrl="^~/email-a-friend/(.[0-9]*).aspx"
    rewriteUrlParameter="ExcludeFromClientQueryString"
    destinationUrl="~/email-a-friend.aspx?nodeID=$1"
    ignoreCase="true" />
    </Action>

    One thing worth noting is that by default the re-directs are 302 re-directs, if you want to do 301 re-directs you need to add the following:

    redirectMode="Permanent"

    You can find the full instructions for the URL re-writing component on their website:

    http://www.urlrewriting.net