Explore by product

Setting up an apex domain and www subdomain

GitHub Pages is available in public repositories with GitHub Free, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see "GitHub's products."

You can set up an apex domain and a www subdomain through your DNS provider and GitHub Pages' servers will automatically create redirects between them. For example, your site can be found at www.example.com or example.com.

If you want an apex domain to work with a www subdomain, such as example.com and www.example.com, then you must configure each domain through your DNS provider and GitHub Pages' servers will automatically create redirects for you. For example:

If the custom domain you added to your GitHub Pages site is example.com, then www.example.com will redirect to example.com

If the custom domain you added to your GitHub Pages site is www.example.com, then example.com will redirect to www.example.com.