Perfect β this is a clean static structure π
Right now youβre using the flat file style:
about.html
contact.html
team.html
publications.html
Thatβs why your URLs are:
/about.html
/contact.html
/team.html
On GitHub Pages, you canβt remove .html via rewrites.
So the correct solution is:
β
Convert Each Page into a Folder with index.html
π§ Step 1 β Restructure Your Files
Change this:
about.html
contact.html
team.html
publications.html
Into this:
about/
index.html
contact/
index.html
team/
index.html
publications/
index.html
Keep your root index.html exactly where it is.
π― Your New Structure Should Look Like:
.
βββ index.html
βββ about/
β βββ index.html
βββ contact/
β βββ index.html
βββ team/
β βββ index.html
βββ publications/
β βββ index.html
βββ assets/
βββ CNAME
...
You are not changing the contents, just moving each file into a folder and renaming it to index.html.
π§ Step 2 β Update Your Links
Change links like this:
β Old
<a href="about.html">About</a>
β
New
<a href="/about/">About</a>
Do this for all internal navigation.
β οΈ Important: Project Site vs User Site
If your site is:
You can safely use:
If your site is:
username.github.io/repo-name/
Then you must include the repo name:
<a href="/repo-name/about/">
Otherwise links break.
π₯ Step 3 β Fix Asset Paths (Very Important)
Because youβre moving files deeper into folders, relative paths like:
<link rel="stylesheet" href="assets/css/main.css">
will break inside /about/index.html.
You have two safe options:
β
Option A (Best): Use Root-Relative Paths
Change all asset links to:
<link rel="stylesheet" href="/assets/css/main.css">
<script src="/assets/js/main.js"></script>
<img src="/assets/images/logos/openbwc-rectangle-logo.png">
This works perfectly if:
- Youβre using a custom domain (you have a
CNAME, so likely yes π)
- Or it's a user site (
username.github.io)
β οΈ If Itβs a Project Site
Then root-relative paths must include the repo name:
/assets/... β
/repo-name/assets/... β
π What Your URLs Will Become
Instead of:
Youβll get:
/about/
/team/
/contact/
/publications/
GitHub Pages automatically serves index.html inside folders.
No config needed. No Jekyll required.
π‘ Why This Works
When someone visits:
GitHub Pages looks for:
Thatβs built into static hosting behavior.
π§ Final Checklist
β Move each .html file into its own folder
β Rename it to index.html
β Update navigation links
β Fix asset paths
β Commit & push
Done.
If you tell me whether this is:
username.github.io
- or
username.github.io/repo-name
Iβll tell you the exact safest linking strategy so nothing breaks.
Perfect β this is a clean static structure π
Right now youβre using the flat file style:
Thatβs why your URLs are:
On GitHub Pages, you canβt remove
.htmlvia rewrites.So the correct solution is:
β Convert Each Page into a Folder with
index.htmlπ§ Step 1 β Restructure Your Files
Change this:
Into this:
Keep your root
index.htmlexactly where it is.π― Your New Structure Should Look Like:
You are not changing the contents, just moving each file into a folder and renaming it to
index.html.π§ Step 2 β Update Your Links
Change links like this:
β Old
β New
Do this for all internal navigation.
If your site is:
You can safely use:
If your site is:
Then you must include the repo name:
Otherwise links break.
π₯ Step 3 β Fix Asset Paths (Very Important)
Because youβre moving files deeper into folders, relative paths like:
will break inside
/about/index.html.You have two safe options:
β Option A (Best): Use Root-Relative Paths
Change all asset links to:
This works perfectly if:
CNAME, so likely yes π)username.github.io)Then root-relative paths must include the repo name:
π What Your URLs Will Become
Instead of:
Youβll get:
GitHub Pages automatically serves
index.htmlinside folders.No config needed. No Jekyll required.
π‘ Why This Works
When someone visits:
GitHub Pages looks for:
Thatβs built into static hosting behavior.
π§ Final Checklist
β Move each
.htmlfile into its own folderβ Rename it to
index.htmlβ Update navigation links
β Fix asset paths
β Commit & push
Done.
If you tell me whether this is:
username.github.iousername.github.io/repo-nameIβll tell you the exact safest linking strategy so nothing breaks.