1
- Custom Domains and White Labeling
2
- =================================
1
+ Custom Domains
2
+ ==============
3
3
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 ``.
7
8
8
- Subdomain support
9
- -----------------
9
+ .. contents ::
10
+ :local:
10
11
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
+ ----------------------
15
14
16
- Custom domain support
17
- ---------------------
15
+ To setup your custom domain, follow these steps:
18
16
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 ``.
20
26
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 ::
46
28
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 .
49
31
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.
51
36
52
- In order to setup your custom domain, follow these steps :
37
+ As an example, fabric's DNS record looks like this :
53
38
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
66
40
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 .
69
43
70
- .. note ::
44
+ .. warning ::
71
45
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.
75
48
76
49
Strict Transport Security
77
- +++++++++++++++++++++++++
50
+ -------------------------
78
51
79
52
By default, we do not return a `Strict Transport Security header `_ (HSTS) for user custom domains.
80
53
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``
85
58
86
59
.. _Strict Transport Security header : https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security
87
60
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
+
88
73
Multiple documentation sites as sub-folders of a domain
89
- +++++++++++++++++++++++++++++++++++++++++++++++++++++++
74
+ -------------------------------------------------------
90
75
91
76
You may host multiple documentation repositories as **sub-folders of a single domain **.
92
77
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
95
80
See :doc: `subprojects ` for more information.
96
81
97
82
Troubleshooting
98
- +++++++++++++++
83
+ ---------------
99
84
100
85
SSL certificate issue delays
101
86
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
102
87
103
88
The status of your domain validation and certificate can always be seen on the details page for your domain
104
89
under :guilabel: `Admin ` > :guilabel: `Domains ` > :guilabel: `YOURDOMAIN.TLD (details) `.
105
90
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.
114
96
115
97
Certificate authority authorization
116
98
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
117
99
118
100
Certificate authority authorization (CAA) is a security feature that allows domain owners to limit
119
101
which certificate authorities (CAs) can issue certificates for a domain.
120
102
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"
124
116
125
117
.. prompt :: bash $, auto
126
118
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"
131
124
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,
133
126
you may see an error message like ``pending_validation: caa_error: YOURDOMAIN.TLD ``
134
127
in the Read the Docs dashboard for your domain.
135
128
You will need to update your CAA records to allow us to issue the certificate.
136
129
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.
139
131
140
132
.. _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
142
133
143
134
.. note ::
144
135
145
136
If your custom domain was previously used in GitBook, contact GitBook support (via live chat in their website)
146
137
to remove the domain name from their DNS Zone in order for your domain name to work with Read the Docs,
147
138
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/" />
0 commit comments