This came about when I asked myself the question “What would be the easiest/quickest way for me to get a company webpage up in order to satisfy Apple’s requirement for registering as a developer”. I already have this blog hosted on Github pages (Source code), and although this setup is a bit convoluted (old installation of Jekyll, css build etc), I still liked the idea of hosting the page as a simple repository, and thought that there had to be a way of doing that with a simple
index.html file (there is).
- A repository containing the source.
- A simple
index.htmlfile that contains everything that’s needed for the page (which is only html and css right now).
- Custom domain name (Apple would not be satisifed with a domain name that isn’t related to the company).
- Have https://www.broccoliventures.com redirect to https://broccoliventures.com, which would be the main domain.
Turns out that Github pages supports “all” this, but some of it wasn’t obvious.
- This official looking guide makes it look like you may only have a single Github page on your Github account (username.github.io), I remember this was a limitation way back when Github pages were new. https://pages.github.com/ makes it quite clear however that it’s possible to create unlimited “project” sites (remember to switch the toggle to “Project site”).
- A lot of guides use
index.mdas an example to add content, and then they show you how to select a prebuilt theme etc. But it’s perfectly fine to add a
index.htmlin your publishing root.
What I did (in order)
- Follow the initial (Creating a GitHub Pages site) guide.
- Configuring a publishing source for your GitHub Pages site
- Configuring an apex domain (as I want https://broccoliventures.com without www. to be the domain name). (I used an
Arecord for each of the listed Github IP addresses). Here’s the CNAME file for the site.
- Configuring an apex domain and the www subdomain variant as I do want redirects from https://www.broccoliventures.com to https://broccoliventures.com.
- Securing your GitHub Pages site with HTTPS
Here it is, at the time of writing the only code is a single
index.html and a