diff --git a/content/codeberg-pages/using-custom-domain.md b/content/codeberg-pages/using-custom-domain.md index 590a8c3..0e8150d 100644 --- a/content/codeberg-pages/using-custom-domain.md +++ b/content/codeberg-pages/using-custom-domain.md @@ -35,18 +35,23 @@ In this case you must add `A` / `AAAA` / `TXT` records for all domains instead o {% endadmonition %} -_We assume for the following description, that you want to serve your website with and without www in front. -If you are on a subdomain already (like myproject.yourdomain.com), you can skip the `www.yourdomain.com` CNAME entry._ +{% admonition "info" "Notice" %} + +Throughout this document, the domain `example.org` is used as a placeholder for your own domain. Please ensure you replace any literal instances of `example.org` with the domain that you've purchased to ensure the proper setup procedure. + +We provide context-appropriate examples for both the apex domain, and the `www` subdomain commonly used for websites. If you wish to use a different subdomain, replace the `www` in the following examples with the hostname of your desired subdomain. If you wish to use the apex domain (that is, the bare domain without any `www.` in front), we recommend additionally setting up a redirect on the `www` subdomain (or vice versa) to ensure compatibility with all browsers and devices. + +{% endadmonition %} {% admonition "Warning" %} -When setting up DNS records with many registrars, any domain added to the `Domain` or `Host` option is automatically +When setting up DNS records with many providers, any domain added to the `Domain` or `Host` option is automatically appended onto the domain the records are being made for. -For example, if your domain is `example.com`, entering `www` will mean the record refers to `www.example.com`. +For example, if your domain is `example.org`, entering `www` will mean the record refers to `www.example.org`. -Therefore, in this guide, you may need to replace references to just your domain name (e.g. `example.com`) with `@` and -`anything.example.com` (i.e. any subdomain) with just `anything`. +Therefore, in this guide, you may need to replace references to just your domain name (e.g. `example.org`) with `@` and +`anything.example.org` (i.e. any subdomain) with just `anything`, depending on your DNS provider. {% endadmonition %} @@ -63,7 +68,7 @@ In the end, it should look like this: - www.yourdomain.com + www.example.org CNAME codeberg.page. @@ -95,12 +100,12 @@ In this case, some DNS providers support an ALIAS record, which will work instea - yourdomain.com + example.org ALIAS codeberg.page - www.yourdomain.com + www.example.org ALIAS codeberg.page @@ -129,12 +134,12 @@ so keep an eye on Codeberg updates to check. - yourdomain.com + example.org A 217.197.84.141 - yourdomain.com + example.org AAAA 2a0a:4580:103f:c0de::2 @@ -174,12 +179,12 @@ set a TXT record on the `_git-pages-repository` subdomain of your domain with th - _git-pages-repository.yourdomain.com + _git-pages-repository.example.org TXT https://codeberg.org/username/repository.git - _git-pages-repository.www.yourdomain.com + _git-pages-repository.www.example.org TXT https://codeberg.org/username/repository.git @@ -197,12 +202,12 @@ set a TXT record on the `_git-pages-forge-allowlist` subdomain of your domain wi - _git-pages-forge-allowlist.yourdomain.com + _git-pages-forge-allowlist.example.org TXT https://codeberg.org/username/repository.git - _git-pages-forge-allowlist.www.yourdomain.com + _git-pages-forge-allowlist.www.example.org TXT https://codeberg.org/username/repository.git @@ -226,11 +231,11 @@ you should choose one of them to be the ‘canonical’ URL, add a [`_redirects` file](/codeberg-pages/advanced-usage/) to your site redirecting from one version to the other, and deploy your website to both domains. (I.e. set up two separate webhooks, or use two separate deploy actions.) -For example, to redirect people from www.yourdomain.com to yourdomain.com, +For example, to redirect people from www.example.org to example.org, use this `_redirects` file: ``` -//www.yourdomain.com/* https://yourdomain.com/:splat 302! +//www.example.org/* https://example.org/:splat 302! ``` For the redirect to work,