Articles on: Custom domain

How to Set up a Redirect Using Cloudflare

A redirect is a way to forward users from one URL to another, and Cloudflare offers an easy way to set up redirects for your website. Here's a step-by-step guide.

To begin, you need to connect the website from which you would like to set up a redirect to Cloudflare. Please follow this guide: Connect Cloudflare and issue a free SSL certificate

Log in to the Cloudflare dashboard and select your account and domain from which you would like to set up a redirect.

Navigate to Page Rules. In the Cloudflare dashboard, locate and click on the "Page Rules" tab.



Click on the "Create Page Rule" button



In the "If the URL matches" field, enter the URL for which you want to apply the redirect. This could be a specific page, directory, or a wildcard pattern. For example:



By using the asterisk (*) character, you can create dynamic patterns that can match many URLs, rather than just one.

In the Then the settings are section, select "Forwarding URL" from the dropdown menu.

After selecting "Forwarding URL," additional fields will appear. Enter the destination URL where you want to redirect the incoming traffic. For example:



Choose the appropriate redirect type:

301 Permanent Redirect: Tells search engines that the old URL has permanently moved to the new URL.
302 Temporary Redirect: Informs search engines that the old URL has temporarily moved to the new URL.



Once you've configured the settings, click on the "Save and Deploy" button to create the redirect rule.

After saving the rule, Cloudflare will apply it to incoming traffic that matches the specified URL. Make sure to test the redirection to ensure it's working as expected.

Updated on: 28/08/2023

Was this article helpful?

Share your feedback

Cancel

Thank you!