Curl: (51) error when trying to check whether or not my website redirects correctly
14,893
Your ssl certificate is propably self-signed, try using curl with the -k
(--insecure
) option which disables ssl verification.
Related videos on Youtube
Author by
Strazz
Updated on June 04, 2022Comments
-
Strazz almost 2 years
When I try to make up a
.htaccess
file to redirect my www to non-www, I get some issues.RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
This is the
.htaccess
file I've used, after using:curl -I https://www
I get:curl: (51) Unable to communicate securely with peer: requested domain name does not match the server's certificate.
But after using
curl -I http://www
I get a 301 redirection, which was my intended case but it redirects to HTTPS www.The problem of that is that I get a DNS error when I'm visiting it on the internet.
How can I possibly fix this?
-
MrWhite over 6 yearsDid you implement HSTS?
-
Strazz over 6 yearsI did indeed do that.
-
-
Strazz over 6 yearsThat seems to give me the right info, but how can I then counter the NET::ERR_CERT_COMMON_NAME_INVALID from Chrome?