Copied to clipboard

Flag this post as spam?

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


  • Bjarne Fyrstenborg 1182 posts 3441 karma points MVP 4x c-trib
    Sep 28, 2012 @ 08:33
    Bjarne Fyrstenborg
    0

    Urlrewrite/redirect from old to new pages

    Hi..

    We have relaunced our website and Google have indexed the old pages..
    Now I want to make a permanent redirect from the old pages to the new ones..

    http://www.google.dk/search?q=picopublish

    E.g. the these pages:

    /index.php -> /da/forside/
    /index.php?id=webdesign -> /da/webdesign/
    /index.php?id=easycatalog -> /da/katalogproduktion/easycatalog/

    I have tried to make the redirect rule for the index.php page in UrlRewriting.config 

    <add name="indexRewrite"
        virtualUrl="~/index.php"
        rewriteUrlParameter="ExcludeFromClientQueryString"
        destinationUrl="~/da/forside/"
        redirect="Application"
        redirectMode="Permanent"
        ignoreCase="true" />

    It also works for index.php which redirect to /da/forside/ .. but e.g. /index.php?id=webdesign then redirect to /da/forside/?id=webdesign ..

    How can setup the rules to match index.php .. and match index.php with the quuerystring?

    /Bjarne

  • Bjarne Fyrstenborg 1182 posts 3441 karma points MVP 4x c-trib
    Sep 28, 2012 @ 14:07
    Bjarne Fyrstenborg
    0

    I found that I could redirect index.php like this:

    <add name="oldRewrite"
    virtualUrl="^~/index.php$"
        rewriteUrlParameter="ExcludeFromClientQueryString"
        destinationUrl="~/da/forside/"
        redirect="Application"
        redirectMode="Permanent"
        ignoreCase="true" />

    then I tried this for the other pages with querystrings after reading this post http://our.umbraco.org/forum/using/ui-questions/3114-url-rewrite-somepageaspxvar=VALUE----somefoldervalueaspx, but it did only work for that level (the level below da node) and the old page and new page must have the same name:

    <add name="leveloneRewrite"
        virtualUrl="^~/index.php\?id=(.*)"
        rewriteUrlParameter="IncludeQueryStringForRewrite"
        destinationUrl="~/da/$1"
        redirect="Application"
        redirectMode="Permanent"
        ignoreCase="true" />

    So instead I redirected the old page manual.. I'm sure if there is a easier way to do this?

    <add name="webdesignRewrite"
        virtualUrl="^~/index.php\?id=webdesign"
        rewriteUrlParameter="IncludeQueryStringForRewrite"
        destinationUrl="~/da/webdesign/"
        redirect="Application"
        redirectMode="Permanent"
        ignoreCase="true" />

    /Bjarne

  • 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