Answered by
Oliver Hall
Setting up a 301 redirect in Cloudflare is a common task for website administrators who want to permanently redirect traffic from one URL to another, ensuring that SEO value is preserved and users are directed to the correct page.
Access your Cloudflare dashboard by logging in at Cloudflare's website.
Choose the site for which you want to set up the redirect.
Click on the 'Rules' tab in the top menu. Here, you'll find options to create Page Rules, which can be used to implement redirects.
Click on 'Create Page Rule'. Enter the URL or the pattern you wish to redirect. For example, if you want to redirect all pages from example.com/old-page.html
to example.com/new-page.html
, enter *example.com/old-page.html*
.
Select 'Forwarding URL' from the dropdown menu of settings, then choose '301 - Permanent Redirect'. In the field that appears, enter the destination URL where you want the requests to be redirected, such as https://example.com/new-page.html
.
Click 'Save and Deploy' to activate your rule.
*
) to match patterns. This is useful for redirecting multiple pages or maintaining URL parameters.By following these steps, you can effectively manage 301 redirects in Cloudflare, which helps maintain SEO rankings and improve user experience by seamlessly directing visitors to the appropriate content.