Pretty url optimization not rewriting

I have the pretty url asset optimization enabled, but my html isn’t being rewritten. For example, I have links in my html that point to “href=‘some-page.html’” and the resulting html that is served up is exactly the same. I was expecting the optimization to rewrite the link to “href=‘some-page/’”. Am I missing something?

@colindresj Welcome to the Netlify community. I don’t know if you’re missing anything, but we are – like a URL or two where we can observe this behavior?

Sure, if you go to https://ryse-app.netlify.app/ you can see that all of the relative hyperlinks still contain the .html extension

@colindresj OK, I see the .html extensions on the loaded pages.

First, though, I don’t think that asset optimization rewrites the links on your pages; I think it only serves the pages under the optimized URL.

Second, this is probably a silly question, but it is possible to turn on asset optimization but leave pretty URLs off, so make certain that you have it checked.

Finally, I believe that asset optimization happens only at the time of deployment, so if you deployed your site last with asset optimization off, and only subsequently turned it on, then pretty URLs would not be retroactively applied to your site.

So, I would double-check that you have pretty URLs selected and then re-deploy your site, if you have not already done so.

1 Like

Oh ok, I misunderstood. I guess since it’s called an asset optimization and grouped along with minification, concatenation, etc. it actually transformed files.

I definitely have it turned on and it’s been on throughout builds, so I guess I just misunderstood the purpose of the feature. Seems weird to me that it’s bucketed under asset optimization if it it’s more of a routing thing.