Skip to content

Add documentation on how to setup a redirect. #395

Open
@rbetts

Description

@rbetts

We should document how to use a redirect to serve a site on both www.example.com and example.com.

One way of redirecting one domain to another is deploying your origin website to the www domain, and setting up another project associated with the non-www domain which serves a simple redirection using JavaScript code as follows:

Deno.serve(() => Response.redirect("https://www.example.com/", 301));

This code will ensure that visitors to the non-www domain get redirected to the www domain with HTTP status code 301 (permanent redirect).

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions