Change the URL of my GitHub Pages Page

I’m trying to set up a static website for my daughter and host it on my github account. I forked a jekyll repository, made some changes, followed the directions - I think. I even read through an awful lot of this forum. I saw some stuff about misspelling the repo name, how to do cname record, etc. but I still have a url issue.

The URL where I can find my page is:

user_name.github.io/repo_name

I would like to change the url to:

repo_name.github.io

Beyond taking me out of the picture, it sure would work better for relative pathing, as my local dev site is localhost:4000/  without an intervening repo_name.

Is ther anyway to affect that chage?

3 Likes

Unfortunately, there isn’t a way to do what you want. There are two naming schemes. When the repo is named username.github.io, then it shows up as [http://username.github.io](http://username.github.io). When it is named anything else, it shows up as [http://username.github.io/reponame](http://username.github.io/reponame). This is to prevent people from attempting to create websites impersonating other GitHub users, since even with CNAMEs the Pages site redirects from the github.io address.

If your daughter is 13 years old or older, you could help her establish her own free GitHub account and set up the Pages site under her account.

12 Likes

Currently I added a custom domain to my github page without properly understanding how it works. Please I need it to return back to the default url

Just remove the CNAME file that has been added to your repo and name your website as before in the settings.

This github repo by yuliskov is hosted at https://smartyoutubetv.github.io/ which doesn’t start with his username and it is also not username(dot)github(dot)io(slash)repo name (Sorry, I couldn’t post more than two URLs). I think question meant to learn about this and so do I. Or am I missing something?

That website is maintained from https://github.com/SmartYouTubeTV/SmartYouTubeTV.github.io. So yes, it does follow the formula of user-or-org-name.github.io. The GitHub repo that you linked to contains the software project that is documented on the website you linked to.