Pretty URLs does not seem to work with Asset optimization disabled (needed for HTTP headers)

  1. Pretty URLs does not seem to work with Asset optimization disabled (since these are now two different settings on /settings/deploys#post-processing).
  2. I need to disable Asset optimization so that HTTP headers (_headers file) are processed, right?

Thanks in advance for fixing number 1!

No. The _headers file is processed regardless.

Thanks, @jasiqli!
I guess, I had this in mind:

Custom headers are not compatible with Netlify’s built-in asset optimization. Assets optimized with that feature will not have custom headers applied. You can Disable asset optimization in Site settings > Build & deploy > Post processing > Asset optimization.

Number 1 is not solved yet, right?

Checking one of my sites that has pretty URLs enabled, visiting a URL ending in .html (e.g. doesn’t strip the .html (e.g., so perhaps pretty URLs aren’t working as intended.

I never use a .html extension in links either internally or externally, so I don’t see it as a major issue (for me.)

Further information I’ve just become aware of @net-user

This may or may not help, and may even be outdated, but there’s also some information about how Netlify serves files in this post


Pretty URLs

Interesting that Cloudflare Pages (yes, that competing service) does redirect (using a 308 Permanent Redirect) as stated in the Route matching.

I personally prefer the Cloudflare method rather than the Netlify method of rewriting <a> elements in my deploy site.

I think a lot of the confusion comes from Rewrite being an overloaded term.

Those having been doing development for many years associate it with server level rewrites/redirects as performed by Apache or IIS.

Netlify uses it both in their Redirects and rewrites documentation in the more traditional sense, but also in various places concerning the Pretty URLs feature to mean rewriting the content of your html file.


Thank you for all your answers!

Netlify also redirects using a 301 when pretty redirects is enabled.

Have not observed that behaviour @hrishikesh. As mentioned above

Would need to see the site :slight_smile:

Naturally. Which I deleted.

Guess this “feature” shall forever remain a mystery to me (and possibly others.)