Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation on how to setup a redirect. #395

Open
rbetts opened this issue Mar 28, 2024 · 0 comments
Open

Add documentation on how to setup a redirect. #395

rbetts opened this issue Mar 28, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@rbetts
Copy link
Contributor

rbetts commented Mar 28, 2024

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).

@rbetts rbetts added the documentation Improvements or additions to documentation label Mar 28, 2024
@crowlKats crowlKats transferred this issue from denoland/deno_doc Mar 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant