Remove the .html file extension from the end of the URL

Hi!

I am trying to make a static website where there isn’t a file extension at the end of the URL.

Instead of mysite.domain/page.html, I want it to be mysite.domain/page

I have seen some solutions on this forum using expressjs with node.js, but I want to know if there’s a way to do it without it because I want the 24/7 uptime that comes with static websites.

Thanks!

1 Like

Others may have thoughts on it but wouldn’t you just remove the extension from your files? The browser requests a file by it’s name and the extension is part of that name.

Sadly just removing tge file extension will make your browser download the file. The easiest way to do it is move page.html to page/index.html and everything will work :slight_smile:

3 Likes

ah… good idea. So the idea is that it downloads the default file when not specifically requested by browser.

Thanks!! :grin:

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