Cloudflare Docs
Support
Support
Visit Support on GitHub
Set theme to dark (⇧+D)

Understanding Cloudflare Mobile Redirect

​​ Overview

Mobile Redirect allows you to automatically redirect mobile device visitors to a mobile-optimized website or subdomain home page. The redirect is done at the edge of Cloudflare’s network, improving the user experience by eliminating a roundtrip to your server.

You must have Cloudflare’s performance service enabled ( “orange clouded” in the DNS Settings) for the redirect to be active.


​​ Enable Mobile Redirect

1. Log into your Cloudflare account.

2. Click the appropriate Cloudflare account for the domain where you want to enable Mobile Redirect.

3. Click the Speed app.

4. Click the Optimization tab.

5. Scroll down to the Mobile section of the Optimization tab.

6. Select the subdomain that you would like to redirect from the drop down list.

7. Choose Keep Path or Drop Path.

8. Toggle switch to On.

Mobile Redirect card with a sample URL, Keep path option, and the feature toggled to


​​ Compatible mobile devices

Browsers from the following mobile devices are redirected to the mobile-optimized subdomain:

  • iPhone
  • Android
  • iPod
  • Blackberry
  • Palm
  • Mobile
  • Windows CE
  • Opera mini
  • AvantGo
  • Docomo

​​ Allow full site view

To allow your end users to view the full site on mobile, you’ll need to set the value of the following cookie on the root domain only to 0 (zero) at your origin server:

__cf_mob_redir = 0; domain=.example.com

In this example, replace .example.com with your root domain.

To renew the mobile redirect, delete the cookie, or set it to expire after whatever duration you choose.


​​ Relevant resources