Migrating your WordPress website from HTTP to HTTPS is an essential step for improving security, increasing trust, and boosting your SEO rankings. However, simply installing an SSL certificate is not enough — you must also set up a proper redirect so that all visitors automatically land on the secure version of your site.
This guide explains step-by-step how to correctly redirect your WordPress site from http:// to https://.
Before you set up redirects, confirm that your SSL certificate is properly installed by accessing:
https://yourdomain.com
If the site loads without errors, you’re ready to continue.
If not, contact your hosting provider or check your SSL settings.
In your WordPress dashboard:
This tells WordPress to use HTTPS by default.
If your hosting uses Apache (most shared hostings do), you can set up a redirect via the .htaccess file in the root folder of your WordPress site.
Add the following code at the top of .htaccess:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
This forces all incoming HTTP requests to redirect to HTTPS with a permanent 301 redirect.
If your server uses NGINX, you need to modify your site configuration file:
server {
listen 80;
server_name yourdomain.com www.yourdomain.com;
return 301 https://$server_name$request_uri;
}
Then reload NGINX:
sudo systemctl reload nginx
Even with redirects, some content may still load over HTTP.
To fix this:
Install a plugin like:
These tools automatically detect and replace insecure links.
Use “Better Search Replace” to change:
http://yourdomain.comhttps://yourdomain.cominside your database.
To ensure everything is loading over HTTPS:
Use online tools like:
This helps identify images, scripts, or styles that still use HTTP.
Finally, test your site:
If everything automatically redirects, your HTTPS setup is complete.
Redirecting a WordPress site from HTTP to HTTPS is straightforward once your SSL certificate is installed. The essential steps include updating WordPress settings, configuring redirect rules on the server, and fixing any mixed content issues.
A proper HTTPS setup:
With the steps above, your WordPress site will be fully switched to secure browsing.