Skip to content

Commit b1dc6ca

Browse files
authored
repo sync
2 parents 08cfae3 + d0edbd2 commit b1dc6ca

18 files changed

Lines changed: 50 additions & 12 deletions
-42.8 KB
Loading
1.57 KB
Loading
-51.6 KB
Loading
34.7 KB
Loading
72.6 KB
Loading
21.6 KB
Loading
-60.2 KB
Loading
-38.8 KB
Loading

content/pages/configuring-a-custom-domain-for-your-github-pages-site/about-custom-domains-and-github-pages.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ topics:
2424
| Custom subdomain | `blog.example.com` |
2525
| Apex domain | `example.com` |
2626

27-
You can set up either or both types of custom domains for your site. We recommend always using a `www` subdomain, even if you also use an apex domain. For more information, see "[Using an apex domain for your {% data variables.product.prodname_pages %} site](#using-an-apex-domain-for-your-github-pages-site)."
27+
You can set up either or both of apex and `www` subdomain configurations for your site. For more information on apex domains, see "[Using an apex domain for your {% data variables.product.prodname_pages %} site](#using-an-apex-domain-for-your-github-pages-site)."
28+
29+
We recommend always using a `www` subdomain, even if you also use an apex domain. When you create a new site with an apex domain, we automatically attempt to secure the `www` subdomain for use when serving your site's content. If you configure a `www` subdomain, we automatically attempt to secure the associated apex domain. For more information, see "[Managing a custom domain for your {% data variables.product.prodname_pages %} site](/articles/managing-a-custom-domain-for-your-github-pages-site)."
2830

2931
After you configure a custom domain for a user or organization site, the custom domain will replace the `<user>.github.io` or `<organization>.github.io` portion of the URL for any project sites owned by the account that do not have a custom domain configured. For example, if the custom domain for your user site is `www.octocat.com`, and you have a project site with no custom domain configured that is published from a repository called `octo-project`, the {% data variables.product.prodname_pages %} site for that repository will be available at `www.octocat.com/octo-project`.
3032

@@ -38,11 +40,11 @@ Subdomains are configured with a `CNAME` record through your DNS provider. For m
3840

3941
A `www` subdomain is the most commonly used type of subdomain. For example, `www.example.com` includes a `www` subdomain.
4042

41-
`www` subdomains are the most stable type of custom domain because `www` subdomains are not affected by changes to the IP addresses of {% data variables.product.product_name %}'s servers. Your site will also load faster because Denial of Service (DoS) attack protection can be implemented more efficiently.
43+
`www` subdomains are the most stable type of custom domain because `www` subdomains are not affected by changes to the IP addresses of {% data variables.product.product_name %}'s servers.
4244

4345
#### Custom subdomains
4446

45-
A custom subdomain is a type of subdomain that doesn't use the standard `www` subdomain. Custom subdomains are mostly used when you want two distinct sections of your site. For example, you can create a site called `blog.example.com` and customize that section independently from `www.example.com`.
47+
A custom subdomain is a type of subdomain that doesn't use the standard `www` variant. Custom subdomains are mostly used when you want two distinct sections of your site. For example, you can create a site called `blog.example.com` and customize that section independently from `www.example.com`.
4648

4749
### Using an apex domain for your {% data variables.product.prodname_pages %} site
4850

content/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ To set up a `www` or custom subdomain, such as `www.example.com` or `blog.exampl
4242

4343
{% data reusables.pages.navigate-site-repo %}
4444
{% data reusables.repositories.sidebar-settings %}
45+
{% data reusables.pages.sidebar-pages %}
4546
4. Under "Custom domain", type your custom domain, then click **Save**. This will create a commit that adds a _CNAME_ file in the root of your publishing source.
4647
![Save custom domain button](/assets/images/help/pages/save-custom-subdomain.png)
4748
5. Navigate to your DNS provider and create a `CNAME` record that points your subdomain to the default domain for your site. For example, if you want to use the subdomain `www.example.com` for your user site, create a `CNAME` record that points `www.example.com` to `<user>.github.io`. If you want to use the subdomain `www.anotherexample.com` for your organization site, create a `CNAME` record that points `www.anotherexample.com` to `<organization>.github.io`. The `CNAME` record should always point to `<user>.github.io` or `<organization>.github.io`, excluding the repository name. {% data reusables.pages.contact-dns-provider %} {% data reusables.pages.default-domain-information %}
@@ -67,6 +68,7 @@ To set up an apex domain, such as `example.com`, you must configure a _CNAME_ fi
6768

6869
{% data reusables.pages.navigate-site-repo %}
6970
{% data reusables.repositories.sidebar-settings %}
71+
{% data reusables.pages.sidebar-pages %}
7072
4. Under "Custom domain", type your custom domain, then click **Save**. This will create a commit that adds a _CNAME_ file in the root of your publishing source.
7173
![Save custom domain button](/assets/images/help/pages/save-custom-apex-domain.png)
7274
5. Navigate to your DNS provider and create either an `ALIAS`, `ANAME`, or `A` record. {% data reusables.pages.contact-dns-provider %}
@@ -92,6 +94,31 @@ To set up an apex domain, such as `example.com`, you must configure a _CNAME_ fi
9294
{% data reusables.pages.build-locally-download-cname %}
9395
{% data reusables.pages.enforce-https-custom-domain %}
9496

97+
### Configuring an apex domain and the `www` subdomain variant
98+
99+
When using an apex domain, we recommend configuring your {% data variables.product.prodname_pages %} site to host content at both the apex domain and that domain's `www` subdomain variant.
100+
101+
To set up a `www` subdomain alongside the apex domain, you must first configure an apex domain, which will create an `ALIAS`, `ANAME`, or `A` record with your DNS provider. For more information, see "[Configuring an apex domain](#configuring-an-apex-domain)."
102+
103+
After you configure the apex domain, you must to configure a CNAME record with your DNS provider.
104+
105+
1. Navigate to your DNS provider and create a `CNAME` record that points `www.example.com` to the default domain for your site: `<user>.github.io` or `<organization>.github.io`. Do not include the repository name. {% data reusables.pages.contact-dns-provider %} {% data reusables.pages.default-domain-information %}
106+
2. To confirm that your DNS record configured correctly, use the `dig` command, replacing _WWW.EXAMPLE.COM_ with your `www` subdomain variant.
107+
```shell
108+
$ dig <em>WWW.EXAMPLE.COM</em> +nostats +nocomments +nocmd
109+
> ;<em>WWW.EXAMPLE.COM.</em> IN A
110+
> <em>WWW.EXAMPLE.COM.</em> 3592 IN CNAME <em>YOUR-USERNAME</em>.github.io.
111+
> <em>YOUR-USERNAME</em>.github.io. 43192 IN CNAME <em> GITHUB-PAGES-SERVER </em>.
112+
> <em> GITHUB-PAGES-SERVER </em>. 22 IN A 192.0.2.1
113+
```
114+
### Removing a custom domain
115+
116+
{% data reusables.pages.navigate-site-repo %}
117+
{% data reusables.repositories.sidebar-settings %}
118+
{% data reusables.pages.sidebar-pages %}
119+
4. Under "Custom domain," click **Remove**.
120+
![Save custom domain button](/assets/images/help/pages/remove-custom-domain.png)
121+
95122
### Further reading
96123
97124
- "[Troubleshooting custom domains and {% data variables.product.prodname_pages %}](/articles/troubleshooting-custom-domains-and-github-pages)"

0 commit comments

Comments
 (0)