How do I redirect all pages on my site to the homepage?

I want all pages, no matter the URL, to redirect to the homepage on the same site.

For example:

mydomain.com/about
mydomain.com/contact
mydomain.com/old-blog-post

…should all redirect to mydomain.com

Here’s what I’ve done so far (step by step in case anyone else finds it helpful):

  1. Login to Cloudflare
  2. Click on the domain to redirect
  3. Rules > Redirect Rules
  4. Click “Create rule”
  5. Add a rule name (ex. Redirect to home)

I’m not sure what to choose from here.

Field?
Operator?
Value?
Type?
Preserve query string checked or unchecked?

Thanks!

See this recent thread for the same question which should give you what you need…

I did see that thread but it seemed like a different question was being asked (i.e. www vs. non-www). Is the solution in my case the same?

Just ignore the www redirect if you don’t need it.

The second screenshot in my solution there deals with redirecting all pages to the index page. The key is to avoid redirecting the index page to the index page and getting a “too many redirects” error which is why / needs to be excluded from any redirect match.

1 Like

Ah OK. I will try. Thank you.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.