Private GitHub Pages redirects to internal url

We want to use Private GitHub Pages, but we found out the nice url: ( https://.github.io/ ) redirects to an internal url, which is not really what we want.

We also cannot seem to get the custom domain working for internal pages.

Is it possible to NOT redirect to the internal url?

Example urls:
nice url: https://philips-internal.github.io/orbit
redirected to url: https://congenial-funicular-829fc4f5.pages.github.io/

It’s not possible to change this, no. The pages.github.io URL needs to be used so GitHub can host an authentication layer in front of your site and ensure that the subsequent site is secure. For more information I’d recommend reading this comment (and subsequent reply) from one of our engineers.

The only current solution for prettifying your internal URL is to use a custom domain.

The custom domain is working, but it has a serious security bug

Let’s pretend I created a custom domain called: “my-custom-domain.com
I’ve created a CNAME so all sub-domains are forwarded to my organizations github.io page.

*.my-custom-domain.com → philips-internal.github.io

Now people can add a custom domain name with sub-domain (like documentation.my-custom-domain.com) to their internal github pages, but… If they do something wrong (like forgetting to code the CNAME in the deploy directory), the custom domain name is not set anymore. Now the url will return in a 404… Also when archiving the repository, the url results in a 404.

What we saw today, is other people outside of our organization claiming the sub domain and there is no way of reverting that. The attacker just took over the url. In our case today, he put a message to contact him, so we’ve fixed it all, but I think one thing can be improved to the way GitHub has implemented this.

When a subdomain is used, and it is aliased to ‘philips-internal.github.io’ , github should only look into the repositories of organization “philips-internal” to resolve the repository by looking for a similar custom domain. Now it also looks for repositories outside of the organization, and this can be used to put information on an internal github page…

If you want to know more about this, please contact me…