Make sure that all of the assets that you link to use absolute paths. That would mean instead of having <script src="script.js"></script> you’d have <script src="/script.js"></script> and likewise for images, css, etc.
add a slash / to the beginning - like in my pictures
This is about the scope
when someone is inside a subdirectory
and your page instructs him that in that directory there is an assets folder
and in fact, it is one or 100 levels above, it is not displayed because it cannot find it
That’s why a slash is added at the beginning of the path
so it would start looking from the root (domain) for that folder/file
You are not stupid - because you looked at it all from the point of view of the website you created and then everything was fine,
but when you introduced error pages in all that
and then tried some URL that has two or three non-existent subfolders in it /.../.../
it is normal for such a thing to happen.
If you don’t mind, I removed “solution” from me and assigned it to @wackyblackie
because he was the first to say what the problem was… I just wrote more text