Help with making extensions go to new pages?

Hello, so I’m working on a website where you start off on one page and then you solve puzzles to move along throughout the website and unlock other puzzles, find hidden lore, stuff like that. I’ll also say now that I’m extremely new to coding in general, and I’m pretty much googling how to do every single thing in HTML, I just haven’t found how to solve this problem. The problem is, I just started on this website today, and I’ve got my first two pages ready. To progress through my website, you have to solve different puzzles, each puzzle giving you a 4 digit code made up of numbers and letters. I’d like to make it so you just have to go to example-example-example.glitch.me/HSBE for example, while having the actual HTML files in my project numbered so it’s easier to keep track of. The only way I’ve been able to do this so far is by naming the HTML file what the 4 digit code is, and then you have to go to example-example-example.glitch.me/HSBE.html. Is there any way at all to have just a 4 letter extension go to these different pages, while still keeping the html files numbered to make it easier to organise? Thanks!

You don’t. The only way to do so is by using Express which would make your project not static and go to sleep after 5 minutes of inactivity.

Not true, you can do this using a static site.

If you want your link to be /HSBE, you would create a folder called HBSE and add an index.html file with the your HTML code. Upon visitng /HSBE you would see that code.

1 Like

No like make it so that if you have a wrong code then it would say wrong code or something like that

You can do that with client side javascript.

No I mean like he said you type in the URL and if it’s 404 say wrong code

:point_up_2:

So you can make a 404 page with client side js.

You can write 404: Not Found to the screen on an incorrect answer.

Hmm… I think people would find the code easier that way.

But it’s like let’s say I made some random code I wanted it to go to 404 in client js like

puzzles.glitch.me/34534

Well actually I figured out a new idea based on how a PWA intercepts page requests. Maybe if a request is sent to a page and a 404 is returned the service worker can override the request content with a custom 404

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