Subject: Redirection based on user agent

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?

Initial Bounce to the Customer

Hello [Customer Name],

Good morning! I am Jane from the Cloudflare Support team, and I am glad to assist you with this case.

Based on the description, I understand that you want to redirect request messages to a specific page based on the User-Agent value. Is that correct?

You are correct that Cloudflare Page Rules cannot support this functionality directly, because they are primary designed for URL-based actions like URL forwarding, caching behaviour and security settings.

However, the Transform Rules, Origin Rules, and Cloudflare Snippets that Cloudflare supports can meet your requirement. Here are the differences between these three features and reference documents. Please pay attention to the feature availibity and limits for different subscription plans.

  • For simple header-based routing to different origins: Use Origin Rules and define expressions that check header values. Refer to: Origin Rules
  • For modifying headers before they reach the origin, which your origin then uses for routing: Use Request Header Transform Rules. Refer to: Transform Rules
  • For complex, dynamic routing logic or advanced header manipulation: Implement Cloudflare Snippets. Refer to: Cloudflare Snippets

  • [Customer Name], I recommend the Origin Rules feature because it is the simplest one to reach your goal, however, please choose based on your current subscription plan and specific requirement. If you need any further assistance when applying these rules, please don't hesitate to reach out, and I will be more than happy to help.

    Have a nice day!

    Best Regards,
    Jane Gang
    Cloudflare Support Engineer

    Return Home Page   Previous Question   Next Question