Unless you’re literally at https://taeer.bar-yam.me/404.html, you’ve navigated to a page on this site that doesn’t exist.
If you’ve navigated to a page that should exist (for instance if you got there via a link from this site) please send me an email at and tell me the details.
You can use one of the navigation buttons up above to get to somewhere else on the site, or press the back button on your browser to get back to where you came from.
But you probably already knew that.
And isn’t that interesting… how we all know what HTTP error 404 is?
If the internet were developed today, there would be universally slicker interfaces, and nobody would ever have seen the raw error number. But because the internet was developed when it was, it became a part of our cultural awareness.
Now even big companies that you would think shouldn’t expose their internal error numbers, still have 404 pages that say “404”. I’ve always found that an incredible anachronism.
It’s relevant that I’m using the nginx
webserver, hosted on server running nixos
, and my website is generated using hakyll
. I’m not going to go into the details of setting those up here.
Though both are fairly easy.
When I searched on the web, people were telling me to put some stuff in a .htaccess
file. My guess is that works for other webserver technology, but not nginx
. The solution that ended up working, was to add the lines
to my nginx configuration.
Well, not quite. On nix, I added
to the appropriate part of my configuration. That is, inside the services.nginx.virtualHosts."taeer.bar-yam.me"
option.
There was one minor bug, which was that the CSS didn’t load, so there was no styling to the page.
After a quick duckduckgo search, I found that the relativized URLs I’d been using in my webpages were messing it up.
See, I had hakyll set up so that the URL /css/default.css
was being translated into ./css/default.css
*. The issue with this is that you don’t actually navigate to where the 404 page is stored, you see it as whatever wrong page you accidentally navigated to, which probably has a different relative path to the CSS file.
* or whatever relative path is appropriate for the webpage.
So now it’s trying to load the CSS file from the wrong place. The solution is to not relativize the URLs and keep it as /css/default.css
, which is what I did.
I test my website by running it locally on my personal computer before I upload it to the server. So it was a little unnerving when the 404 page didn’t appear when I was testing it.
The issue here is that the configuration that allows the 404 page to work is through nginx, which is only running on the server. It’s a little annoying that you can’t test it locally first, but such is life.