Hosting / General

301 Redirects

When you change the structure of your website, you should redirect the old URLs to the new pages.

To set up 301 redirects:

  1. Create a file called 301.txt at the root of your site
  2. Specify the redirects in this file using the following syntax
old-url new-url

CloudCannon supports redirects to external domains and wildcard matching with *. Here’s an example file:

/about.html /about/
/category/* /new-category
/should-have-been-elsewhere/ http://example.com

Redirects will only occur if the redirect-from page/location no longer exists within the site. If the page/location still exists within your site, this will be served instead of performing a redirect.

You can redirect to, but not from a URL fragment (e.g. #example-heading). The fragment is not passed to the server so cannot be processed by the redirect.

arrow_back

Hosting / General

Introduction

Read previous doc
arrow_forward

Hosting / General

404 Page

Read next doc