Private GitHub Pages redirects to internal url

We want to use Private GitHub Pages, but we found out the nice url: ( ) 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:
redirected to url:

It’s not possible to change this, no. The 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: “
I’ve created a CNAME so all sub-domains are forwarded to my organizations page.

* →

Now people can add a custom domain name with sub-domain (like 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 ‘’ , 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…