Skip to content

Commit fabfc4c

Browse files
committed
Docs: update custom domains docs
1 parent fddd885 commit fabfc4c

File tree

7 files changed

+144
-139
lines changed

7 files changed

+144
-139
lines changed

docs/user/canonical-urls.rst

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
Canonical URLs
2+
==============
3+
4+
Canonical URLs allow you to have consistent page URLs across all your domains.
5+
This is mainly useful for search engines,
6+
so that they can send users to the correct version and domain of your documentation.
7+
8+
The canonical URL is generated based on:
9+
10+
* The default version of your project (usually "latest" or "stable").
11+
* The canonical :doc:`custom domain </custom-domains>` if you have one,
12+
otherwise the default :ref:`subdomain <hosting:subdomain support>` will be used.
13+
14+
.. contents::
15+
:local:
16+
17+
Example
18+
-------
19+
20+
Fabric hosts their docs on Read the Docs,
21+
but they use their own domain ``http://docs.fabfile.org``.
22+
This means that Google will index both ``http://fabric-docs.readthedocs.io`` and
23+
``http://docs.fabfile.org`` for their documentation.
24+
25+
Fabric will want to set ``http://docs.fabfile.org`` as their canonical domain,
26+
this means that when Google indexes ``http://fabric-docs.readthedocs.io``,
27+
it will know that it should really point at ``http://docs.fabfile.org``.
28+
29+
Implementation
30+
--------------
31+
32+
If you are using :doc:`Sphinx </intro/getting-started-with-sphinx>`,
33+
Read the Docs will set the value of the html_baseurl_ setting (if isn't already set) to your canonical domain.
34+
35+
.. _html_baseurl: https://www.sphinx-doc.org/page/usage/configuration.html#confval-html_baseurl
36+
37+
For :doc:`MkDocs </intro/getting-started-with-mkdocs>` this isn't done automatically,
38+
but you can use the site_url_ setting.
39+
40+
.. _site_url: https://www.mkdocs.org/user-guide/configuration/#site_url
41+
42+
If you look at the source code for the documentation built after you set your canonical URL,
43+
you should see a bit of HTML like this:
44+
45+
.. code-block:: html
46+
47+
<link rel="canonical" href="http://docs.fabfile.org/en/2.4/" />
48+
49+
.. note::
50+
51+
If you change your default version or canonical domain,
52+
you'll need to re-build all your versions in order to update their
53+
canonical URL to the new one.

docs/user/custom_domains.rst

+74-133
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,53 @@
1-
Custom Domains and White Labeling
2-
=================================
1+
Custom Domains
2+
==============
33

4-
Once a project is imported into Read the Docs,
5-
by default it's hosted under a subdomain on one of our domains.
6-
If you need a custom domain, see :ref:`custom_domains:custom domain support`.
4+
With custom domains you can serve your documentation from your own domain.
5+
By default your documentation is served from a Read the Docs :ref:`subdomain <hosting:subdomain support>`:
6+
``<slug>.readthedocs.io`` or ``<slug>.readthedocs-hosted.com``,
7+
for example ``https://pip.readthedocs.io``.
78

8-
Subdomain support
9-
-----------------
9+
.. contents::
10+
:local:
1011

11-
Every project has a subdomain that is available to serve its documentation.
12-
If you go to ``<slug>.readthedocs.io``, it should show you the latest version of your documentation.
13-
A good example is https://pip.readthedocs.io
14-
For :doc:`/commercial/index` the subdomain looks like ``<slug>.readthedocs-hosted.com``.
12+
Adding a custom domain
13+
----------------------
1514

16-
Custom domain support
17-
---------------------
15+
To setup your custom domain, follow these steps:
1816

19-
You can also host your documentation from your own domain.
17+
#. Go the :guilabel:`Admin` tab of your project.
18+
#. Click on :guilabel:`Domains`.
19+
#. Enter your domain.
20+
#. Mark the :guilabel:`Canonical` option if you want use this domain
21+
as your :doc:`canonical domain </canonical-urls>`.
22+
#. Click on :guilabel:`Add`.
23+
#. At the top of the next page you'll find the value of the CNAME record that you need to point your domain to.
24+
For |org_brand| this is ``readthedocs.io``, and for :doc:`/commercial/index`
25+
the record is in the form of ``<hash>.domains.readthedocs.com``.
2026

21-
.. note::
22-
23-
We don't currently support pointing subdomains or root domains to a project using A records.
24-
DNS A records require a static IP address and our IPs may change without notice.
25-
26-
.. tabs::
27-
28-
.. tab:: Read the Docs Community
29-
30-
In order to setup your custom domain, follow these steps:
31-
32-
#. For a subdomain like ``docs.example.com``, add a CNAME record in your DNS that points the domain to ``readthedocs.io``.
33-
For a root domain like ``example.com`` use an ANAME or ALIAS record pointing to ``readthedocs.io``.
34-
#. Go the :guilabel:`Admin` tab of your project
35-
#. Click on :guilabel:`Domains`
36-
#. Enter your domain and click on :guilabel:`Add`
37-
38-
By default, we provide a validated SSL certificate for the domain.
39-
This service is generously provided by Cloudflare.
40-
The SSL certificate issuance can take about one hour,
41-
you can see the status of the certificate on the domain page in your project.
42-
43-
As an example, fabric's DNS record looks like this:
44-
45-
.. prompt:: bash $, auto
27+
.. note::
4628

47-
$ dig CNAME +short docs.fabfile.org
48-
readthedocs.io.
29+
For a subdomain like ``docs.example.com`` add a CNAME record,
30+
and for a root domain like ``example.com`` use an ANAME or ALIAS record.
4931

50-
.. tab:: Read the Docs for Business
32+
By default, we provide a validated SSL certificate for the domain,
33+
this service is provided by Cloudflare.
34+
The SSL certificate issuance can take about one hour,
35+
you can see the status of the certificate on the domain page in your project.
5136

52-
In order to setup your custom domain, follow these steps:
37+
As an example, fabric's DNS record looks like this:
5338

54-
#. Go the :guilabel:`Admin` tab of your project
55-
#. Click on :guilabel:`Domains`
56-
#. Enter your domain and click on :guilabel:`Add`
57-
#. Follow the steps shown on the domain page.
58-
This will require adding 2 DNS records, one pointing your custom domain to our servers,
59-
and another allowing us to provision an SSL certificate.
60-
61-
By default, we provide a validated SSL certificate for the domain.
62-
The SSL certificate issuance can take a few days,
63-
you can see the status of the certificate on the domain page in your project.
64-
65-
.. note::
39+
.. prompt:: bash $, auto
6640

67-
Some older setups configured a CNAME record pointing to ``<organization-slug>.users.readthedocs.com``.
68-
These domains will continue to resolve.
41+
$ dig CNAME +short docs.fabfile.org
42+
readthedocs.io.
6943

70-
.. note::
44+
.. warning::
7145

72-
You will need to keep the extra DNS records after the setup is complete.
73-
If you remove the verification record, the certificate won't renew automatically,
74-
and if you remove the CNAME pointing to us, your domain won't serve the documentation.
46+
We don't support pointing subdomains or root domains to a project using A records.
47+
DNS A records require a static IP address and our IPs may change without notice.
7548

7649
Strict Transport Security
77-
+++++++++++++++++++++++++
50+
-------------------------
7851

7952
By default, we do not return a `Strict Transport Security header`_ (HSTS) for user custom domains.
8053
This is a conscious decision as it can be misconfigured in a not easily reversible way.
@@ -85,8 +58,20 @@ for our own domains including ``*.readthedocs.io``, ``*.readthedocs-hosted.com``
8558

8659
.. _Strict Transport Security header: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security
8760

61+
Legacy domains on |com_brand|
62+
-----------------------------
63+
64+
Some older setups configured a CNAME record pointing to
65+
``<organization-slug>.users.readthedocs.com``,
66+
these domains will continue to resolve.
67+
68+
Previously you were asked to add two records,
69+
this process has been simplified.
70+
If you have doubts about deleting some of the old records,
71+
please reach out to :ref:`support <support:user support>`.
72+
8873
Multiple documentation sites as sub-folders of a domain
89-
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
74+
-------------------------------------------------------
9075

9176
You may host multiple documentation repositories as **sub-folders of a single domain**.
9277
For example, ``docs.example.org/projects/repo1`` and ``docs.example.org/projects/repo2``.
@@ -95,103 +80,59 @@ This is `a way to boost the SEO of your website <https://moz.com/blog/subdomains
9580
See :doc:`subprojects` for more information.
9681

9782
Troubleshooting
98-
+++++++++++++++
83+
---------------
9984

10085
SSL certificate issue delays
10186
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10287

10388
The status of your domain validation and certificate can always be seen on the details page for your domain
10489
under :guilabel:`Admin` > :guilabel:`Domains` > :guilabel:`YOURDOMAIN.TLD (details)`.
10590

106-
* For |org_brand|, domains are usually validated and a certificate issued within minutes.
107-
However, if you setup the domain in Read the Docs without provisioning the necessary DNS changes
108-
and then update DNS hours or days later,
109-
this can cause a delay in validating because there is an exponential back-off in validation.
110-
Loading the domain details in the Read the Docs dashboard and saving the domain again will force a revalidation.
111-
* For |com_brand|, domains can take up to a couple days to validate and issue a certificate.
112-
To avoid any downtime in moving a domain from somewhere else to Read the Docs,
113-
it is possible to validate the domain and provision the certificate before pointing your domain to Read the Docs.
91+
Domains are usually validated and a certificate issued within minutes.
92+
However, if you setup the domain in Read the Docs without provisioning the necessary DNS changes
93+
and then update DNS hours or days later,
94+
this can cause a delay in validating because there is an exponential back-off in validation.
95+
Loading the domain details in the Read the Docs dashboard and saving the domain again will force a revalidation.
11496

11597
Certificate authority authorization
11698
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11799

118100
Certificate authority authorization (CAA) is a security feature that allows domain owners to limit
119101
which certificate authorities (CAs) can issue certificates for a domain.
120102
This is done by setting CAA DNS records for your domain.
121-
CAA records are typically on the root domain, not subdomains
122-
since you can't have a CNAME and CAA record for the same subdomain.
123-
Here's an example for palletsprojects.com:
103+
104+
The readthedocs domains that you'll point your domains to already
105+
have the proper CAA records.
106+
107+
.. prompt:: bash $, auto
108+
109+
$ dig +short readthedocs.io CAA
110+
0 issue "digicert.com; cansignhttpexchanges=yes"
111+
0 issuewild "digicert.com; cansignhttpexchanges=yes"
112+
0 issue "comodoca.com"
113+
0 issue "letsencrypt.org"
114+
0 issuewild "comodoca.com"
115+
0 issuewild "letsencrypt.org"
124116

125117
.. prompt:: bash $, auto
126118

127-
$ dig CAA +short palletsprojects.com
128-
0 issue "digicert.com"
129-
0 issue "comodoca.com"
130-
0 issue "letsencrypt.org"
119+
$ dig +short 0acba22b.domains.readthedocs.com CAA
120+
proxy-fallback.readthedocs-hosted.com.
121+
0 issue "digicert.com"
122+
0 issue "comodoca.com"
123+
0 issue "letsencrypt.org"
131124

132-
If there are CAA records for your domain that do not allow the certificate authorities that Read the Docs uses,
125+
In case that there are CAA records for your domain that do not allow the certificate authorities that Read the Docs uses,
133126
you may see an error message like ``pending_validation: caa_error: YOURDOMAIN.TLD``
134127
in the Read the Docs dashboard for your domain.
135128
You will need to update your CAA records to allow us to issue the certificate.
136129

137-
* For |org_brand|, we use Cloudflare which uses Digicert as a CA. See the `Cloudflare CAA FAQ`_ for details.
138-
* For |com_brand|, we use AWS Certificate Manager as a CA. See the `Amazon CAA guide`_ for details.
130+
We use Cloudflare, which uses Digicert as a CA. See the `Cloudflare CAA FAQ`_ for details.
139131

140132
.. _Cloudflare CAA FAQ: https://support.cloudflare.com/hc/en-us/articles/115000310832-Certification-Authority-Authorization-CAA-FAQ
141-
.. _Amazon CAA guide: https://docs.aws.amazon.com/acm/latest/userguide/setup-caa.html
142133

143134
.. note::
144135

145136
If your custom domain was previously used in GitBook, contact GitBook support (via live chat in their website)
146137
to remove the domain name from their DNS Zone in order for your domain name to work with Read the Docs,
147138
else it will always redirect to GitBook.
148-
149-
Canonical URLs
150-
--------------
151-
152-
Canonical URLs allow people to have consistent page URLs for domains.
153-
This is mainly useful for search engines,
154-
so that they can send people to the correct page.
155-
156-
Read the Docs uses these in two ways:
157-
158-
* We point all versions of your docs at default version, usually "latest" or "stable", as canonical.
159-
* We point at the user specified canonical URL, generally a custom domain for your docs.
160-
161-
Example
162-
+++++++
163-
164-
Fabric hosts their docs on Read the Docs.
165-
They mostly use their own domain for them ``http://docs.fabfile.org``.
166-
This means that Google will index both ``http://fabric-docs.readthedocs.io`` and
167-
``http://docs.fabfile.org`` for their documentation.
168-
169-
Fabric will want to set ``http://docs.fabfile.org`` as their canonical URL.
170-
This means that when Google indexes ``http://fabric-docs.readthedocs.io``,
171-
it will know that it should really point at ``http://docs.fabfile.org``.
172-
173-
Enabling
174-
++++++++
175-
176-
You can set the canonical URL for your project in the Project Admin page.
177-
Check your :guilabel:`Admin` > :guilabel:`Domains` page for the domains that we know about.
178-
179-
Implementation
180-
++++++++++++++
181-
182-
If you are using :doc:`Sphinx </intro/getting-started-with-sphinx>`,
183-
Read the Docs will set the value of the html_baseurl_ setting (if isn't already set) to your canonical domain.
184-
185-
.. _html_baseurl: https://www.sphinx-doc.org/page/usage/configuration.html#confval-html_baseurl
186-
187-
If you are using :doc:`MkDocs </intro/getting-started-with-mkdocs>`,
188-
you can use the site_url_ setting.
189-
190-
.. _site_url: https://www.mkdocs.org/user-guide/configuration/#site_url
191-
192-
If you look at the source code for documentation built after you set your canonical URL,
193-
you should see a bit of HTML like this:
194-
195-
.. code-block:: html
196-
197-
<link rel="canonical" href="http://docs.fabfile.org/en/2.4/" />

docs/user/faq.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ http://docs..org/projects/kombu/en/latest/
141141

142142
You can add subprojects in the project admin dashboard.
143143

144-
For details on custom domains, see our documentation on :doc:`/custom_domains`.
144+
For details on custom domains, see our documentation on :doc:`/custom-domains`.
145145

146146

147147
Where do I need to put my docs for RTD to find it?

docs/user/features.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ we assign you a URL based on your project name.
2626
You are welcome to use this URL,
2727
but we also fully support custom domains for all our documentation projects.
2828

29-
Learn more about :doc:`/custom_domains`.
29+
Learn more about :doc:`/custom-domains`.
3030

3131
Versioned Documentation
3232
-----------------------

docs/user/guides/technical-docs-seo-guide.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ The canonical URL tells search engines where the original version
161161
your documentation is even if you have multiple versions on the internet
162162
(for example, incomplete translations or deprecated versions).
163163

164-
Read the Docs supports :ref:`setting the canonical URL <custom_domains:Canonical URLs>`
165-
if you are using a :doc:`custom domain </custom_domains>`
164+
Read the Docs supports :doc:`setting the canonical URL </canonical-urls>`
165+
if you are using a :doc:`custom domain </custom-domains>`
166166
under :guilabel:`Admin` > :guilabel:`Domains`
167167
in the Read the Docs dashboard.
168168

docs/user/hosting.rst

+10
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ We support a number of important features that you would expect for a documentat
88
:local:
99
:depth: 1
1010

11+
Subdomain support
12+
-----------------
13+
14+
Every project has a subdomain that is available to serve its documentation.
15+
If you go to ``<slug>.readthedocs.io``, it should show you the latest version of your documentation,
16+
for example https://pip.readthedocs.io.
17+
For :doc:`/commercial/index` the subdomain looks like ``<slug>.readthedocs-hosted.com``.
18+
19+
.. seealso:: :doc:`/custom-domains`.
20+
1121
Content Delivery Network (CDN)
1222
------------------------------
1323

docs/user/index.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ and some of the core features of Read the Docs.
7676

7777
* **Overview of core features**:
7878
:doc:`/integrations` |
79-
:doc:`/custom_domains` |
79+
:doc:`/custom-domains` |
8080
:doc:`/versions` |
8181
:doc:`/downloadable-documentation` |
8282
:doc:`/hosting` |
@@ -108,7 +108,8 @@ and some of the core features of Read the Docs.
108108

109109
/config-file/index
110110
/integrations
111-
/custom_domains
111+
/custom-domains
112+
/canonical-urls
112113
/versions
113114
/downloadable-documentation
114115
/hosting

0 commit comments

Comments
 (0)