GitHub pages defaulting to a randomly generated name instead of <whatever>.github.io
Asked Answered
C

1

7

I'm working in a repo I created under an organizational GitHub

When I publish the repo via GitHub pages the URL defaults to a randomly generated string, such as

http(s)://windy-waterfalls-e5r23og9.pages.github.io/

I'd like it to default to http(s)://<username>.github.io/<repository> or http(s)://<organization>.github.io/<repository> so that the URL is explanatory of the repo, and so I don't have to pay/manage my own domain

Is there a way to do this?

Concrescence answered 18/8, 2021 at 15:0 Comment(3)
The gh-pages url depends on the repo name for the url. Have you checked docs.github.com/en/pages/getting-started-with-github-pages/…Lely
Yea, if I make a repo that's not under the organizational GitHub the name defaults to https://testore.github.io/test-repo/ for example. The issue only occurs under the organizational GitHub and I can't find any docs related to default URL settings; only for using a completely custom domainConcrescence
If your GitHub pages site is configured to be private, the domain will be such randomly generated one. See docs.github.com/ja/pages/getting-started-with-github-pages/…Tormoria
C
5

This occurs when the gh pages visibility is set to private

According to About subdomains for privately published sites

Privately published sites are available at a different subdomain than publicly published sites. This ensures that your GitHub Pages site is secure from the moment it's published.

We use a unique subdomain for the privately published site to ensure that other repositories in your organization cannot publish content on the same origin as the site

According to Organization-level custom domain not working for internal repository pages #23350

For security reasons, private Pages sites (the ones with a random default hostname that enforce authentication + authorization on access) need to be isolated.

Workarounds

  1. If the info isn't sensitive, you can go to Settings > Set the Visibility to Public
  2. You can still set a custom domain to avoid having a long set of garbled characters in your URL
Consumption answered 5/11, 2022 at 11:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.