diff --git a/content/applications/websites/website/configuration/domain_names.rst b/content/applications/websites/website/configuration/domain_names.rst index 8fff0633a..140a96630 100644 --- a/content/applications/websites/website/configuration/domain_names.rst +++ b/content/applications/websites/website/configuration/domain_names.rst @@ -174,7 +174,7 @@ The specific instructions depend on your DNS hosting service. - `Namecheap: How to create a CNAME record for your domain `_ - `OVHcloud: Add a new DNS record `_ - `Cloudflare: Manage DNS records - `_ + `_ .. important:: Odoo only supports subdomains. To use your naked domain name :dfn:`(a domain name without any @@ -190,6 +190,58 @@ The specific instructions depend on your DNS hosting service. Next, create a redirect (301 permanent or visible redirect) to redirect visitors from `yourdomain.com` to `wwww.yourdomain.com`. +Using Cloudflare to secure and redirect a naked domain +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +To redirect a naked domain with a secure HTTPS connection, we recommend using Cloudflare, as most +DNS hosting services do not offer an easy way to do so. + +#. `Sign up and log in to Cloudflare `_. +#. Enter your domain name on `Cloudflare's dashboard `_ and + select :guilabel:`Quick scan for DNS records`. +#. Choose a plan (the free plan is sufficient). +#. Follow Cloudflare's instructions and recommendations to complete the activation. +#. Add a CNAME record to redirect your naked domain (`yourdomain.com`) to the `www` subdomain + (e.g., `www.yourdomain.com`) by clicking :guilabel:`DNS` in the navigation menu, then clicking + the :guilabel:`Add record` button, and using the following configuration: + + - :guilabel:`Type`: CNAME + - :guilabel:`Name`: `@` (or `yourdomain.com`) + - :guilabel:`Target`: e.g., `www.yourdomain.com` + - :guilabel:`Proxy status`: Proxied + + .. image:: domain_names/cloudflare-cname-www.png + :alt: Adding a CNAME DNS record to Cloudflare to redirect a naked domain to a www subdomain + +#. Add another second CNAME record to redirect the `www` subdomain (e.g., `www.yourdomain.com`) to + your database address (e.g., `mycompany.odoo.com`) using the following configuration: + + - :guilabel:`Type`: CNAME + - :guilabel:`Name`: e.g., `www.yourdomain.com` + - :guilabel:`Target`: e.g., `mycompany.odoo.com` + - :guilabel:`Proxy status`: DNS only + + .. image:: domain_names/cloudflare-cname-db.png + :alt: Adding a CNAME DNS record to Cloudflare to redirect a www subdomain to an Odoo database + +#. Define a page rule to permanently (301) redirect your naked domain + `/*` (e.g., + `yourdomain.com/*`) to `https://www.` + your naked domain + `/$1` (e.g., + `https://www.yourdomain.com/$1`) by going to :menuselection:`Rules --> Page Rules --> Create Page + Rule`, and using the following configuration: + + - :guilabel:`URL`: e.g., `yourdomain.com/*` + - :guilabel:`Pick a Setting`: Forwarding URL + - :guilabel:`Select status code`: 301 - Permanent Redirect + - :guilabel:`Enter destination URL`: e.g., `https://www.yourdomain.com/$1` + + .. image:: domain_names/cloudflare-page-rule.png + :alt: Defining a Cloudflare page rule to create a permanent redirect (301) + +#. Go to :guilabel:`SSL/TLS` and set the encryption mode to :guilabel:`Full`. + + .. image:: domain_names/cloudflare-encryption.png + :alt: Setting the encryption mode to full on Cloudflare + .. _domain-name/db-map: Map a domain name to an Odoo database diff --git a/content/applications/websites/website/configuration/domain_names/cloudflare-cname-db.png b/content/applications/websites/website/configuration/domain_names/cloudflare-cname-db.png new file mode 100644 index 000000000..d30218820 Binary files /dev/null and b/content/applications/websites/website/configuration/domain_names/cloudflare-cname-db.png differ diff --git a/content/applications/websites/website/configuration/domain_names/cloudflare-cname-www.png b/content/applications/websites/website/configuration/domain_names/cloudflare-cname-www.png new file mode 100644 index 000000000..2e26e037b Binary files /dev/null and b/content/applications/websites/website/configuration/domain_names/cloudflare-cname-www.png differ diff --git a/content/applications/websites/website/configuration/domain_names/cloudflare-encryption.png b/content/applications/websites/website/configuration/domain_names/cloudflare-encryption.png new file mode 100644 index 000000000..f5d26351e Binary files /dev/null and b/content/applications/websites/website/configuration/domain_names/cloudflare-encryption.png differ diff --git a/content/applications/websites/website/configuration/domain_names/cloudflare-page-rule.png b/content/applications/websites/website/configuration/domain_names/cloudflare-page-rule.png new file mode 100644 index 000000000..7aa6d29d0 Binary files /dev/null and b/content/applications/websites/website/configuration/domain_names/cloudflare-page-rule.png differ