Cloudflare Pages truncates URLs by removing the ".html" extension

Dear Cloudflare,
Two days ago I migrated my website hosting from Netlify to Cloudflare Pages. I discovered that Cloudflare Pages redirects any .html request to a URL without the extension. You’ve broken my analytics reporting which I rely on to provide insights into changes over time in traffic to specific pages. Now I can’t compare traffic to pages on Cloudflare with previous traffic to the same pages. I’m also concerned because users will copy the Cloudflare URL and add the extension-less link to their own webpages, which means if I migrate away from Cloudflare in the future, backlinks will break. Regardless of Cloudflare’s opinion or helpful intent, URLs containing filenames with extensions have been part of the HTTP standard since the earliest days. I’d like to stick with the standard.

Do you offer any option or setting to disable the spurious removal of the .html extension?

2 Likes

This is has been discussed many times:

https://community.cloudflare.com/search?q=%22.html%22%20%23developers%3Acloudflare-pages

Thank you. I’ve seen the previous discussions, including a response that Cloudflare will offer the option to preserve the .html extension. Do you know if the option is available?

I saw that previous discussions didn’t recognize why it might be desirable to preserve the .html extension. I hope my question above explains why it’s important to me and perhaps others as well.

Sorry, you didn’t mention that at all. Based on your initial question, that was not apparent, as that’s the same question asked before. As of yet, the situation has not changed.

1 Like

Would like to add another request to allow preserving .html filename extensions. Given how often is has been discussed, it may be worth implementing (as promised in 2022). Also seems unusual that .htm extensions (and all others) are unaffected. Many of my URLs go back over 20 years, and having them suddenly change is not ideal. One workaround that was recommended is to double the .html extension, e.g., file.html.html.

Too late to update my post above, but after testing, just wanted to share that doubling the .html extension breaks index page display (e.g., example.com/blog/ just displays a blank page, though example.com/blog/index.html works).

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