I am developing a website from scratch for fun and I have started to create different pages for it: home (index.html), about me (about.html) etc. Right now I have all html files in the same root folder and use <a href="about.html">About me</a>
to link to it. This creates the adress http://127.0.0.1:5500/about.html when I click the link.
Instead I want the adress to be http://127.0.0.1:5500/about when I click the link.
I tried to read up on this and came to a working solution of putting the about.html file in a folder called about, and then renaming the html file to index.html. There are however 2 problems with this approach:
- If I get lots of pages on my site I will overflow my root with folders and I won't be able to find anything. It would be nice if I could put them in e.g. a structure root/pages/about/index.html but this creates the wrong slug. And also:
- The home page index.html must be in root if I understand correctly. So if I have other pages in separate folders the references (links/scripts etc) in them would have to look different, at least have a "../" before all references. This will surely lead to typos and bugs when I have a large structure and want to change something from my page template that should go in all pages/files.
Are there any other solutions to create the correct "/about" slug instead of "/about.html", or can any of my above concerns with my working solution be adressed?