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.
Enable Mobile Redirect
Select your account and zone.
Go to Speed > Optimization > Other.
For Mobile Redirect, select the subdomain that you would like to redirect from the drop down list.
Choose Keep Path or Drop Path:
- Keep Path will redirect all mobile requests to the same resource hosted on your mobile-optimized website.
- Drop Path will redirect all mobile requests to your mobile-optimized website homepage.
Toggle switch to On.
Compatible mobile devices
Browsers from the following mobile devices are redirected to the mobile-optimized subdomain:
- Windows CE
- Opera mini
Allow full site view
To allow your end users to view the full site on mobile, you will need to set the value of the following cookie on the apex domain only to 0 (zero) at your origin server:
__cf_mob_redir = 0; domain=.example.com
In this example, replace .example.com with your apex domain.
To renew the mobile redirect, delete the cookie, or set it to expire after whatever duration you choose.