• PRODUCT

    PRODUCT

  • PRICING
    PRICING

  • HELP
    HELP

  • BLOG
    BLOG

  • APPSTORE
    APPSTORE

  • COMPANY
    COMPANY

  • LEGAL
    LEGAL

  • LOGIN
    LOGIN

  • Part 2: preserve SEO link juice by using 301 redirects your single page applications


  • In the second installment of the series, we will discuss strategies for creating catchall views inside your izy apps that will handle preserving the SEO link and redirects


  • The nav framework will capture the undefined path elements and route them to the first defined view in your frame nav definition.

    the currentUrlMatchedAgainst property of the framegetparams may be used to achieve this goal.

    View Definition

    We should define the browse as the first view:

    {

    path: 'browse/.*',

    pattern: {

    matches: ['querystring']

    },

    views: {

    body: modtask.ldmod('kernel/path').rel('browse')

    }

    }

    The definition will result in the following behavior in the browse view :

    Path currentUrlMatchedAgainst matches

    mydomain.com/blog "" {}

    mydomain.com/blog/ "" {}

    mydomain.com/blog/123 123 {}

    mydomain.com/browse browse {}

    mydomain.com/browse/ browse/ {}

    mydomain.com/browse/1 browse/1 { querystring: 1 }

    So we can just write a simple logical expression to decide on a 301 redirect or staying on and showing the data. You may refer to the part1 of the series to see how.

    Sample Implementation

    Please refer to izyware/viewer/blog/browse/frame for details.

    Izy Tip

    Always verify the redirects by using the [MetaScope] app. It will help you verify:

    1) The redirected page has the correct meta values (in the perspectives tab)

    2) The 301 status gets sent (in the http headers tab)

    If you find issues and need to debug the server side behavior, you can always use the izy-circus command line interface:

    node cli.js method render bootstrapUrl https://izyware.com/chrome_extension.js entrypoint izyware:viewer/top uri /blog/create-seo-friendly-and-crawlable-single-page-izyware-apps domain izyware.com renderingVersion 2 cache.folder /tmp/izy-circus/


  • Izyware Blog
    Izyware Blog