If you're trying to direct an old domain in Cloudflare to a new domain, this short article will explain how to do so.
Steps
- Login to Cloudflare
- Click on your domain
- Visit Rules -> Redirect Rules
- Click on Create Rule
- Name your rule "old to new"
- Select radio button "All incoming requests"
- Then... URL redirect equals Type = Dynamic and Expression =
concat("https://newdomain.com",http.request.uri.path)
* replace newdomain.com with your new domain name
- Checkbox "Preserve query string"
- Status code = 301
- Click on deploy
- Test test test.