PageRule 301 redirect for subdomain not working

Hi Team,

Can you please shed some light, what are the correct settings to make the subdomain redirect work (refer to the screenshot for details)

If you want page rules (or nearly any other Cloudflare feature) to work you need to enable proxied :orange: mode.

Thanks Dave for you response I have tried below, but still redirect doesn’t work

I agree with @thedaveCA. It needs to be proxied and moreover the redirection needs to be done on the main domain. Could you share cURL result or do you have the ticket opened?

Thank you for the input guys, found the issue with the help of the support team.

Redirect is failing because of the SSL issue - Cloudflare only supports first-level sub-domains (xyz.domainA.com) - I am trying to redirect (www.xyz.domainA.com to xyz.domainB.com) which will only works if we have custom SSL certificate for the second-level subdomain.

Glad you find the solution. Happy weekend and stay safe!

To add a bit more detail; REDIRECT will work between domains without requiring SSL for SaaS. This would be a ‘Forwarding URL’ page rule saying ‘redirect traffic to xyz.domaina.com to xyz.domainb.com’. This simply tells the browser where to go and it will establish a new session to xyz.domainb.com.

If you add an orange clouded CNAME however for ‘xyz’ (on domain.com) pointing to ‘xyz.domainb.com’ then that is not redirecting and is instead CNAMEing across zones. In that case you do need SSL for SaaS to terminate the SSL connection correctly.

2 Likes

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