Redirecting an URL to another URL from the same domain doesn't work

I’m trying to redirect *genify.ai/en* to https://www.genify.ai$2 (which would redirect for example www.genify.ai/en/home to https://www.genify.ai/home, if I understood the doc about page rules correctly).

My website (genify.ai) is deployed to a cloudflare worker. According to https://developers.cloudflare.com/workers/learning/getting-started#7-configure-your-project-for-deployment, I’ve setup the following DNS AAAA records:

  • genify.ai to 100::, proxy status to proxied (orange cloud)
  • www to 100::, proxy status to proxied (orange cloud)

And I have the following page rules:

I tried adding page rules, such as *genify.ai/en* Forwarding URL (Status Code: 302 - Temporary Redirect, Url: https://www.genify.ai$2), but it doesn’t work.

Why doesn’t it work? How can I troubleshoot it? And Is implementing the redirect in the website code the only solution?

That should work. And you can get by with just one rule. Match genify.ai/* (leave off the HTTP/S part and it will match both).

Can you post a screenshot of your Page Rules?

Can you also confirm that on the bottom of your DNS page that Kolton and Tess are your name servers?

Here is the screenshot of my Page Rules:

And yes, I confirm that Kolton and Tess are my NS (set by default by cloudflare)

Ok. I’m stumped. Hopefully some staff from #JanJam will drop in within the hour to check this.

1 Like

@jpaul.wenger it seems like you are missing a forward slash / in your first pagerule to match the *denify.ai/en* since the match is required for the /en and/or everything afterwards

2 Likes

Thanks @tobi. But I can’t even get the 2nd or 3rd Page Rule to trigger.

How’s your app routing work either regarding the Cloudflare page rules?
Are you having only HTTP, and when using Cloudflare you have HTTPS?
Is your app configured to use www sub-domain or not?

I have HTTPS with a cloudflare SSL certificate.
My domain has 2 subdomains (which have CNAME to somewhere else, such as a domain hosted in AWS).

I’m afraid I don’t understand your first question “How’s your app routing work either regarding the Cloudflare page rules?”

Thanks!

I think it’s time to open a ticket. After you open the ticket, be sure to post the ticket number here to push it along.

To contact Cloudflare Customer Support, login & go to Cloudflare | Web Performance & Security and select get more help. If you receive an automatic response that does not help you, please reply and indicate you need more help.

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