Api request url are not redirected

Hello,

I added a page rule to redirect www.exemple.com to exemple.com

When I navigate to the www url I can see in the browser that I’ve been redirected to the new url.

However, I when I make requests from my front-end to exemple.com/api it doesn’t work.
There is no error server side but on the client side the Request Header and Request url is still www.exemple.com even though I updated my environment variable API_URL :frowning:
What am I doing wrong ?

You didn’t post the rule you’re using, but I bet you’re missing the * at the end

Match www.example.com/*
Forward to https://example.com/$1

Sorry I forgot to indicate that !
I wish it was only that but I didn’t forgot the *

my rule is :
www.exemple.com/*
https://exemple.com/$1

permanent redirect 301

That should do it, but without an actual domain name, we can’t troubleshoot.

It is now working hut I havn’t done anything. It might have been a caching issue, I guess.

1 Like

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