skip to content

Forwarding your GitHub Pages link to custom domain

/ 1 min read

GitHub Pages offer a free hosting service for static sites. The setup is simple and concisely described on To enable this feature all you have to do is to create a public repo named ${your-github-username}, e.g. “metters”.

I am hosting my site somewhere else, so I would like to forward from to there. All I had to do is adding a file named CNAME containing the url to forward to, e.g.

Requests to “” are now being forwarded:

Terminal window
<head><title>301 Moved Permanently</title></head>
<center><h1>301 Moved Permanently</h1></center>

Let’s see where the redirect leads to (not without filtering out some noise)

Terminal window
# Use "location" to follow redirects; "sed" to retrieve the title of the body of the response
# Get anything between the "<title>" tags and print it
curl --silent --location "" | sed -n 's/.*<title>\(.*\)<\/title>.*/\1/p'
Home •