I’m currently working on a new WordPress Site and (ofc) want to redirect all HTTP traffic to HTTPS. They way I tried it is by defining this in my .htaccess
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
For the landingpage this works fine, but all posts are still accessible through HTTP without getting redirected. Any ideas why this could be happening?
2
Answers
Appareantly the order of the configs is important. When placing is at the very top of the
.htaccess
it worked as expected.Here, There are a couple different options you have when choosing to redirect HTTP to HTTPS in WordPress.
E.g. Method for redirecting WordPress running on Nginx.
E.g. Method for redirecting WordPress running on Apache.
E.g. The third option you have to redirect from HTTP to HTTPS is to use the free WordPress Really Simple SSL plugin.