Cloudflare removing the .html from all of my requests when proxied

Hi everyone,

It seems like when my requests are proxied through Cloudflare, the .html at the end of my links get removed. Anyone know how I could make Cloudflare not do this? I did just move from Cloudflare pages to a different host.

Thanks!

EDIT: I think this is because I moved from Cloudflare pages to a different hosting. Is there a way that I could purge this behavior? Purging cache doesn’t seem to work…

Is this so? Are you sure your DNS records now point to your actual host? And if you were using Pages before, did you delete all of that?

Yeah, I repointed my DNS all correctly. And deleted all my pages stuff.

Cloudflare wouldn’t do this with default settings. I’d experiment with ‘curl’ and watch the server logs. And check Rules → Transform Rules to see if there’s anything in there.

If that doesn’t shed any light on it, try a ‘curl’ direct to the origin:
curl -svo /dev/null https://example.com/test.html --connect-to ::123.123.123.123

OK. So the Transform Rules had nothing. Let me try cURL.

EDIT: so it seems like the cURL worked fine… could it be my browser doing this?

This is what is in my browser dev tools.

Also, after turning off proxy, it seems like it still does it for some pages. When checking the dev tools, it says 308 and redirects to the page without the .html which causes a 404 error. This result is cached. Using a private window solves this.

1 Like

Does anyone know why Cloudflare does this with proxy on?

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