Subdomain + cloudflare + https

Started by wwwmaster@, Sep 26, 2022, 12:11 PM

Previous topic - Next topic

wwwmaster@Topic starter

Greetings!

I need help finding an answer regarding my use of Cloudflare and their free SSL certificate. My website works with SSL through https://mydomen.net/ and https://www.mydomen.net/, but when I create a subdomain with https://test.mydomen.net/, it works with SSL while https://www.test.mydomen.net/ gives me an error message saying "Error when establishing a secure connection". Although, http://www.test.mydomen.net/ works perfectly without SSL. Even when disabling SSL, http://www.test.mydomen.net/ still works, while https://www.test.mydomen.net/ encounters the same error message.

My question is: Why isn't the SSL certificate working on www.test or any other subdomain? How can I resolve this issue? Is there a way to automate redirection from https://www.test.mydomen.net/ to https://test.mydomen.net/ using Cloudflare?
  •  

-DM-

In my opinion, it's important to set up a 301 redirect on subdomains and domains to the main mirror so that users don't access the website using different variations such as one with "www" or without. It's also advisable to choose one variation and stick to it for consistency purposes. These are just my thoughts on the matter.
  •  

wwwmaster@Topic starter

-DM- , I do not understand you.
To make a redirect (gluing) - you need to make the version with the www subdomain work. And I, as I wrote above, does not work. That's why I created this topic.
  •  

-DM-

Quote from: wwwmaster@ on Sep 26, 2022, 02:10 PMI do not understand you.
I don't understand you - you can redirect from any url related to a domain.
For example, to sift out the most insane user inputs and direct them to the main one...
However, you know better.
  •  

wwwmaster@Topic starter

I'll ask again then.
How do I make a 301 redirect from https://www.test.mydomen.net/ to https://test.mydomen.net/ via cloud? What, and where do I have to write it on the server?
  •  

Term

Https via cloudflare is a self-deception and a surrogate, I think. Better to make a normal certificate on the server, the same Lets Encrypt has long existed.
And the www has long been unnecessary.
  •  

-DM-

Have you tried reaching out to technical support or referring to the FAQ and other Cloudflare resources for your inquiry? Unfortunately, I do not have any specific tips for you. However, I highly suggest going through the relevant sections on the Cloudflare Dashboard and Help pages as they should have everything you need for a solution to your issue.

It's worth noting that Cloudflare already provides automatic renewal certificates for both domains and subdomains, along with backup certificates, so there's no need to go through extra movements every three months. Additionally, Cloudflare can help fix mixed content and organize HSTS. These are important aspects to keep in mind when using their services.
  •  

Vopiros

The issue you are facing with SSL certificates on your subdomain could be due to the way Cloudflare handles SSL by default. By default, Cloudflare only provides SSL for the apex domain (e.g., mydomen.net) and the www subdomain (e.g., www.mydomen.net).

To resolve this issue and obtain SSL certificates for other subdomains, including www.test.mydomen.net, you can follow these steps:

1. Log in to your Cloudflare account.
2. Navigate to the "SSL/TLS" settings section.
3. Scroll down to the "Edge Certificates" section.
4. Under the "Certificate" dropdown menu, select "Full (strict)".
5. Then, click on the "Create Certificate" button to generate a new certificate.
6. In the new certificate creation page, enter the subdomain you want the SSL certificate for (e.g., test.mydomen.net).
7. Click on the "Next" button and follow the instructions to complete the certificate creation process.
8. Repeat steps 6-7 for any additional subdomains you want to secure.
9. Once all the certificates are created, Cloudflare will automatically deploy them to their edge servers, enabling SSL for your subdomains.

Regarding the redirection from https://www.test.mydomen.net/ to https://test.mydomen.net/, you can achieve this using Cloudflare's Page Rules feature. Here's how you can set up the redirection:

1. Go to the "Page Rules" section in your Cloudflare account.
2. Create a new page rule by clicking on the "Create Page Rule" button.
3. In the "If the URL matches" field, enter `https://www.test.mydomen.net/*`.
4. Select the "Add a Setting" button and choose the "Forwarding URL" option.
5. Enter `https://test.mydomen.net/$1` in the "Destination URL" field.
6. Select the "301 - Permanent Redirect" option.
7. Click on the "Save and Deploy" button to activate the page rule.

With these steps, you should be able to resolve the SSL certificate issue on your subdomains and set up a redirection from https://www.test.mydomen.net/ to https://test.mydomen.net/.

  •