How to force SSL with .htaccess

Hi.

Im using wordpress and i wanna secure my web with SSL.
I made my own CSR and key in Cpanel.

Now i made This Directory: /htdocs/.well-known /acme-challenge/

and i paste my files for both “www” and non “www” in there.
and after running links to get a Certificate i just can see an empty page with some random characters and numbers and nothing wont show up and my ssl service will give me error so i can’t do anything.

i tried to edit “htaccess” file so i got another error and looks like i need to change this file.

Whatever , Just wanna ask , How Do i can install my SSL on my website.

Thank you.
Regards.

You can install SSL without complicated steps by just using Cloudflare, either from the cPanel or from dash.cloudflare.com. You can’t install Let’s Encrypt with the files verification method because there is a security system that unfortunately blocks even Let’s Encrypt’s bot, so Cloudflare should be a way to go, but if the SSL option is set automatically to Flexible change it to Full to not have redirect loops, and configure WordPress from the http version of the wp-admin to have the https version of the URL and save the configuration. Then wait 24 hours for DNS propagation and access the wp-admin again via the https version. Install Cloudflare from there and input the email and the Global API Key that you can get from your profile’s settings on Cloudflare. After that, go on the Crypto section on the Cloudflare dashboard and enable “Always use HTTPS” and “Automatic HTTPS Rewrites”.

Thanks.

I tried cloudflare and i wrote my domain name and i got this error:
Please ensure you are providing the root domain and not any subdomains (e.g., example.com, not subdomain.example.com)

my web address is: www.antiparent.rf.gd

what shout i do ?

Thanks, Regards.

You can’t use Cloudflare on subdomains, nor add the domain with www (www is considered a subdomain, so add the domain without www).
You can get a free domain here that you can point to this hosting with the nameservers ns1.byet.org and ns2.byet.org (if you go on Freenom do NOT choose the .tk domains, and copy the nameservers as they are, without doing “Copy link address”), then add it on the hosting account on the “Parked Domains” section of the Control Panel, go to the old URL’s wp-admin and, in the settings, change the URL from http://antiparent.rf.gd to http://{the domain got from Freenom} and save the changes. After that relogin to the wp-admin and add the domain without the www part and the http:// one on Cloudflare, selecting the Free plan, continuing and changing the nameservers to their ones. After all of those things, refresh the page after a minute, go on the Crypto section and, if you see that the SSL option is set to “Flexible” change it to “Full”. Go on the http version of the wp-admin again with the domain acquired from Freenom, go on the settings and change the http version of the URL to the https one, then save the changes and wait 24 hours for DNS propagation. Then go on the Cloudflare dashboard and, always from the Crypto section, enable “Always Use HTTPS” and “Automatic HTTPS Rewrites”.

1 Like

Thank you.

1 Like

Use CloudFlare nameserver, it won’t expect your current nameserver (InfinityFree)
Or you can install CloudFlare from the cPanel.

This has been solved; have you read the complete post before posting? Thanks for specifying a part of my post too.

Yes right , but , subdomains are not allowed.

hi again.
excuse me , its a while im trying to use Freenom service but unfortunately i got my country have problem with this web so i can’t use it.

There can be any other way to get an SSL for subdomains ?

Thank you so much.

There is a Sectigo Free Trial SSL if you want to install SSL in a subdomain, and methods to get them with email/CNAME verification.

well, looks im always in trouble :sweat_smile:
icoudn’t use that too , because they wont provide any free or trial services.
so , I tried CAcert , and i got build my own CSR and KEY by Cpanel and i used that service and i got CSR and i paste it and has been accepted but nothing happened.
Now what can be wrong ?

THNX AGAIN ! :wink::smile:

For me they provide them; are you sure you’ve checked the menu on Sectigo’s website or scrolled down on InstantSSL for it? If not this is the link to know more about it and then buy it.

1 Like

okay thanks , i got it , and i did everyhitng i got my all .crt files , i paste my CSR and now ,nothing happen.

somethings is wrong ?

Then copy the certificate contents for your domain after opening the Notepad file containing it, paste it in the “Certificate” box, click on “Upload Certificate”, wait at least 1 hour and try to visit the website again.

i did it and i wait for 24 hours but still i have not SSL sceurity.
i check my service and all info and i see my SSL service is active and active.
i really have no idea.

Go to the HTTP version of the wp-admin on your website, go on the settings, change the URLs of the website from http to https, save the changes and login. Then install “Really Simple SSL”, enable it, and click on “Continue; enable SSL”.

1 Like

Ergastolator1 THANKS A LOT LOT LOT LOT !!!:heart_eyes::kissing_heart:

You are super coool !!!:sparkling_heart:

all of my problems has been fixed.:blush:

Thanks AGAIN ! :wink:

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.