diff --git a/content/applications/websites/website/configuration/domain_names.rst b/content/applications/websites/website/configuration/domain_names.rst index 140a96630..ff2de5354 100644 --- a/content/applications/websites/website/configuration/domain_names.rst +++ b/content/applications/websites/website/configuration/domain_names.rst @@ -224,18 +224,27 @@ DNS hosting services do not offer an easy way to do so. .. 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: +#. Define a redirect rule to permanently redirect (301) your naked domain (e.g., `yourdomain.com`) + to both `http://` and `https://` by going to :menuselection:`Rules --> Redirect Rules --> Create + rule`, and: - - :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` + - Enter any :guilabel:`Rule name`. + - Under the :guilabel:`If incoming requests match...` section, select :guilabel:`Custom filter + expression` and use the following configuration: - .. image:: domain_names/cloudflare-page-rule.png - :alt: Defining a Cloudflare page rule to create a permanent redirect (301) + - :guilabel:`Field`: Hostname + - :guilabel:`Operator`: equals + - :guilabel:`Value`: e.g., `yourdomain.com` + + - Under the :guilabel:`Then...` section, use the following configuration: + + - :guilabel:`Type`: Dynamic + - :guilabel:`Expression`: e.g., `concat("https://www.yourdomain.com/", http.request.uri.path)` + - :guilabel:`Status code`: 301 + - :guilabel:`Preserve query string`: enabled + + .. image:: domain_names/cloudflare-redirect-rule.png + :alt: Defining a Cloudflare redirect rule to create a permanent redirect (301) #. Go to :guilabel:`SSL/TLS` and set the encryption mode to :guilabel:`Full`. 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 deleted file mode 100644 index 7aa6d29d0..000000000 Binary files a/content/applications/websites/website/configuration/domain_names/cloudflare-page-rule.png and /dev/null differ diff --git a/content/applications/websites/website/configuration/domain_names/cloudflare-redirect-rule.png b/content/applications/websites/website/configuration/domain_names/cloudflare-redirect-rule.png new file mode 100644 index 000000000..55eb683f7 Binary files /dev/null and b/content/applications/websites/website/configuration/domain_names/cloudflare-redirect-rule.png differ