I recently found out how to remove the .html (or .htm) extensions in the URL for HTML files, but without an .htaccess file!
It’s actually pretty simple to do, and I’m surprised I haven’t seen this tutorial anywhere. You just need to utilize index.html files in folders (I think you get where I’m going now) like below.
After you’ve created the HTML file and have all the code in it that you want, go to that page but don’t include the index.html, and watch in amazement as there’s no file extension; or an ending /! (depending on if you include that or not)
What @Crazy is showing here is a built-in feature of how Glitch handles static web projects. Nothing about that has changed recently, so this should still work as outlined (and in fact the project mentioned, https://crazz.glitch.me/, seems to work as advertised).
If you’re not seeing the same thing can you provide your project name so we can take a look?
I have a Bit of Code Which Does the Same thing sort of but you can name the file anything
And URL Can be Anything:
app.get("/blog", function(req, res) {
res.sendFile(__dirname + “/index.txt”);
console.log(“Received GET”);
});
if you type https://your-project-name.glitch.me/blog it will send that File
if Change blog to something else you can have anything you want
I use it With express to Build a Webpage as well as an API
(Note; when you load a page in a Browser it sends a GET Request )
Thought i show Everyone This Since i don’t Think it would qualify as it Own topic
Good Stuff Though i will say!
Edit: I plan on Making my Webpage go to These URL’s rather then path Find a File
Edit 2: Oh Just so you know you put it in a Javascript File
If the css is in the root folder make the src ./style.css instead of /style.css because it will search the current directory for that file. Hope this helps :).