All entries

    Verify Trailing-Slash Redirects and Canonicals on Netlify

    Test all versions of a page URL and confirm the final response identifies the same preferred route.

    Route signs and a checklist sit beside a laptop and city map
    Conceptual pixel-art illustration.

    Test all versions of a page URL and confirm the final response identifies the same preferred route.

    Build the example

    Pick one live article and check the canonical host, alternate host, slash and no-slash forms. Inspect the first response without following redirects, then follow the chain with a bounded hop count. Use a GET for the canonical HTML because a HEAD request returns no body. Keep sitemap URLs and internal links in the final canonical form.

    For each variant, save the starting URL, first status, final status, hop count and canonical from the destination HTML. Test in a private browser session or with curl so cached permanent redirects do not hide your newest rule. Document which forms intentionally redirect and which canonical forms should return 200 directly.

    Teaching example
    curl -sS -o /dev/null -D - https://example.com/blogs/demo/
    curl -sS -L --max-redirs 5 -o /dev/null -w '%{http_code} %{num_redirects} %{url_effective}
    ' https://example.com/blogs/demo/

    Watch the failure boundary

    Inspect absolute canonical URLs and the final response after any HTTP-to-HTTPS hop. Rules often behave differently when a platform already normalizes a path. Keep host and slash variants in the same test matrix. Record status and Location at every hop, rather than counting only whether the browser eventually loads.

    Verify the behavior

    Create a test case that intentionally points the slash redirect back at the unslashed route and then adds the opposite rule. Verify the check reports a loop. Test an unknown article too. A renderer may send a polished error page, but its HTTP status should still be 404.

    FURTHER READING

    Sources

    Technical references checked .

    END OF ENTRY / 75
    Eeshan Singh with Big Ben in London
    BEHIND THE JOURNAL

    Eeshan Singh

    I’m Eeshan Singh Pokharia, an AI Full Stack Developer and CoFounder of UltraFit360. I work across AI features, full-stack product development, and web and mobile experiences—from Figma and frontend interactions to the systems behind them.

    Inspect absolute canonical URLs and the final response after any HTTP-to-HTTPS hop. Rules often behave differently when a platform already normalizes a path. Keep host and slash variants in the same test matrix. Record status and Location at every hop, rather than counting only whether the browser eventually loads.

    Meet the author
    THE CONVERSATION

    Your side of the story.