Is Your Site Redirecting HTTP to HTTPS? Here's How to Check
Is Your Site Redirecting HTTP to HTTPS? Here's How to Check You've installed an SSL certificate, great. But is traffic automatically being sent to the secure HTTPS version of your site? A common ov...

Source: DEV Community
Is Your Site Redirecting HTTP to HTTPS? Here's How to Check You've installed an SSL certificate, great. But is traffic automatically being sent to the secure HTTPS version of your site? A common oversight is having the certificate in place but failing to enforce the redirect from HTTP. This leaves visitors hitting the insecure version of your domain, which is bad for SEO, user trust, and data security. Let's cover how to check this and fix it. Checking with curl The command-line tool curl is your friend here. It allows us to make raw HTTP requests and inspect the responses. We're looking for a 301 Moved Permanently or 302 Found redirect status code. To test the HTTP to HTTPS redirect, open your terminal and run: curl -I http://yourdomain.com Replace yourdomain.com with your actual domain. The -I flag tells curl to fetch only the headers, not the body of the response. In the output, you'll want to see something like this: HTTP/1.1 301 Moved Permanently Location: https://yourdomain.com/