Rewrite, not Redirect certain URL

I have Cloudflare redirect/cache all requests: ->

Now, apple requires ( that the applinks descriptor file (.well-known/apple-app-site-association) to NOT redirect with 301

real url should stay without “www.” added:

I’ve tried adding full URI matches to Page rules, Rewrite rules, Cache rules… all end up with

Connecting to…|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: `` [following]

What I’m looking for is a Rewrite, not a Redirect. Not sure if that’s doable though?

Based on your description, it sounds to me like exempting that specific URL from your existing redirect might be another option, as long as your origin will serve that request.

Where is your current redirect configured?
Is it in Cloudflare or at your origin server?

It might be possible using Transform Rules.

Thanks! Very good question - maybe I’m redirecting before Cloudflare… Didn’t think of that, I’ll check!

1 Like

Or after, depending on your perspective. :wink:

Let us know what you find and how you wind up achieving the result that you need. yeah I think that was it - seems the origin server was setup to redirect to actually

so that would have been

GET → cloudflare → origin server → 301 www.
GET → cloudflare → origin server → proper response

From what I can see from history, this has something to do with a wordpress bug/feature related to www
But we use next instead of wordpress now, and I don’t like www. anyway so it’s definitely gone from everywhere

1 Like

hm can’t find the edit button

so flow was:

GET → cloudflare → origin server → 301 www.
GET → cloudflare → origin server → proper response

Keywords are Cloudflare assetlinks apple .well-known apple-app-site-association redirect and Dreamhost by the way (for google to pick up this :wink:

1 Like

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