Dynamic page rule redirect not working with cookie on static site

Hello there, i have a static site with a custom domain hosted on cloudflare.
My code sets a cookie with javascript and the cookie is properly set in the browser.
And even read by the page redirect rule.

According to that cookie i like to make a dynamic page redirect to www.example.com/en/
The value in the cookie is also properly read by the rule i set.

But for what ever reason after the request is redirected according to the cookie value the page cannot be resolved eg found.

This are the page redirect rules:
Expression: concat(“https://”,http.host,“/”,“en”)

The site is normally proxied by cloudflare, am i missing something ?

Help is appreciated

Not that it matters, but you could join the last two elements into “/en”.

What exactly is the rule doing? Could you post the expected as well as the actual redirect-to address?

Hey sure thanks for looking at this.
Its actually a simple Cloudflare pages site no npm, no node. Its redirecting from default language to language by cookie or by _redirects.

Cookie was working for some time, but then it stopped :slight_smile:

And as far as i researched there is no possibility to use redirects with simple Cloudflare pages. Also not for cookie to redirect.

Cloudflare Pages _redirects has no documented support for redirects based on cookie.

Do you mean you’ve got a Redirect Rule based on cookie that stopped working?

Yep for 1 Day :slightly_smiling_face:. My point was essentially to get some kind of redirect in cloudflare pages working but thats not going to happen. Now i know.

1 Like