When ever i make a page so it ends with .html and therefore when i open the page it also shows like website.com/how.html
but i dont want to show that .html
I searched on google and they are saying you need to tweak into .htaccess but ig netlify doesnt have .htaccess file so how do i remove the .html now?
By default, if you have a page example.com/about.html, it is automatically available via example.com/about. However, you can also enable “Pretty URLs” under Site Settings > Asset Optimization
I enabled this option and nothing happened. The .html at the end of my URL is still there and I have redeployed several times; as well as waiting a few days and constantly refreshing.
From testing, .html stripping does work as intended. What doesn’t (seem to) work is stripping the extension when a path ending in .html is entered manually into the address bar (i.e./page1.html isn’t redirected/rewritten to /page1.) I don’t know if this is intended or not (ping @hillary for possible clarification.)
Best practice IMHO is to not use extensions in links either internally or externally. So instead of having
<a href="/page1.html" title="Page 1">Page 1</a>
use
<a href="/page1" title="Page 1">Page 1</a>
and add a <link> element with rel="canonical" e.g.