Back to Home

Question

I want to redirect visitor with specific user agent (MSIE 8.0 for example) to a different page. It seems this is not possible with Cloudflare Page Rules. Is there any other way to achieve that using Cloudflare?

Answer:

Hello,

Thank you for reaching out to Cloudflare Support.

You are correct that Cloudflare Page Rules do not support redirecting visitors based on their user agent. However, you can achieve this functionality using Cloudflare Workers.

First, please see the guide at Cloudflare Workers: Getting Started to create and deploy your first Worker.

Write the Worker Script to redirect users. For detailed instructions on how to deploy and bind the Worker to your desired route, please refer to Cloudflare Workers: Redirect Example.

Save and deploy your Worker script. Once you have deployed the Worker, any visitor using the specified user agent will be redirected to the designated page.

If you need any further assistance, please don't hesitate to reach out.

Best regards,
Ari Bovolente | Cloudflare Support

Thought Process:

First, I've confirmed that Cloudflare Page Rules do not support user agent-based redirects. Through research, I found that Cloudflare Workers can be a solution in this case because Workers allow for more complex request handling, so I've provided the necessary documentation and steps to set up a Cloudflare Worker for this, and reassure the customer of Cloudflare's ongoing support to provide further details if needed.

Tools:

Documentation resources: Information about Cloudflare Workers and how to redirect users.

Browser Developer Tools: To test the user agent-based redirects.

JavaScript: To write the Worker script to redirect users with the user agent MSIE 8.0, for example.