Copied to clipboard

Flag this post as spam?

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


  • Tajamal 87 posts 175 karma points
    Feb 03, 2016 @ 13:41
    Tajamal
    0

    Permanent reidrect

    Hi

    I am in need of a permanent redirect solution for all urls from my old site to a new site. This should redirect all requests, including google and other bots.

    Any tips since i am new to umbraco hope you guys can help me.

  • Dan Diplo 1554 posts 6205 karma points MVP 6x c-trib
    Feb 03, 2016 @ 19:58
    Dan Diplo
    0

    You could try the 301 URL tracker package - https://our.umbraco.org/projects/developer-tools/301-url-tracker/

    If you have access to IIS you can install the URL Rewrite module and then add rewrites to web.config - http://www.iis.net/downloads/microsoft/url-rewrite.

    You can also add rewrites in the /config/UrlRewriting.config file in Umbraco which uses URL Rewrite module - https://github.com/aspnetde/UrlRewritingNet

  • Tajamal 87 posts 175 karma points
    Feb 04, 2016 @ 09:46
    Tajamal
    0

    Hi Dan

    301 Url tracker package does not work with version 7.3.x, which i have. I will wait for next stable version.

    I will try the third option UrlRewriting.config file in Umbraco. If i understand the rules, i have to add the rules for all pages, as below examples. Correct me if i am wrong

    <add name="produktidrewrite" 
                        virtualUrl="^~/product/somepage.aspx" 
                        rewriteUrlParameter="ExcludeFromClientQueryString" 
                        destinationUrl="~/product/some-page" 
                        ignoreCase="true" />
    
    <add name="produktidrewrite" 
                        virtualUrl="^~/product/test/game.aspx" 
                        rewriteUrlParameter="ExcludeFromClientQueryString" 
                        destinationUrl="~/product/test-game" 
                        ignoreCase="true" />
    
    <add name="produktidrewrite" 
                        virtualUrl="^~/pipeline/trees.aspx" 
                        rewriteUrlParameter="ExcludeFromClientQueryString" 
                        destinationUrl="~/pipeline/tree" 
                        ignoreCase="true" />
    
  • Dan Diplo 1554 posts 6205 karma points MVP 6x c-trib
    Feb 04, 2016 @ 10:03
    Dan Diplo
    0

    Yes, Tajamal - you will generally need to create a rule for each page. However, you can also use "wildcard" matching where you can target multiple old URLs and redirect them to the same destination URL.

    I think in your case if all you are doing is stripping the .aspx extension from the old URL then you should be able to create a single rewrite that does that.

    You can find documentation here: http://blog.thomasbandt.de/content/binary/UrlRewritingNet20.English.pdf

  • Ajay Rathod 8 posts 77 karma points
    Feb 04, 2016 @ 10:19
    Ajay Rathod
    0

    Hello Tajamal, Try Write code In UrlRewriting.config for Url-Rewrite and Redirect For Url :- Example :-

    http://www.test.com.au/test1/test2/test3

    I am Use This Code For Level 2 Of Url-Rewrite and Redirect:-

      <add name="redirect_test_level2" redirect="Application" redirectMode="Permanent" virtualUrl="^~/test1/(.*)/(.*)/$" rewriteUrlParameter="IncludeQueryStringForRewrite" destinationUrl="~/$1/$2" ignoreCase="true" />
    <add name="test-rewrite-level2"
                    virtualUrl="^/(test2)/(.+)/?$"
                    rewriteUrlParameter="ExcludeFromClientQueryString"
                    destinationUrl="/test1/$1/$2"
                    ignoreCase="true" />
    

    Get Results :-

    http://www.test.com.au/test2/test3

  • Tajamal 87 posts 175 karma points
    Feb 05, 2016 @ 10:09
    Tajamal
    0

    Thanks Dan

    My scenario includes all types of changes to the page. It wont necessary be same title or tree structure. Path may be different url's will mostly be different.

    I am thinking of writing my own code to achieve this, where i have all mapped URL's in xml file. I like to have my own code and be less dependent on third parties.

Please Sign in or register to post replies

Write your reply to:

Draft