Enable HTTPS for specific pages only

Last updated on June 26th, 2022 at 11:41 am

Many of us wonder if it is possible to enable HTTPS for specific pages on a WordPress site. The answer is simple – yes, it’s absolutely possible.

But some SEO experts say that switching to HTTPS from an HTTP version of a site could have negative impact on your site’s rankings in search engines. But once a site has switched to HTTPS there are many situations that could make us wonder if disabling HTTPS for specific pages on the site will make our SEO rank issues even worse.

The good news is that search engines are already intelligent enough and if you made the switch to HTTPS for your WordPress correctly, they should start ranking your site even on higher positions as it is now fully encrypted through HTTPS.

But for various reasons, we might need to disable HTTPS for some of the pages of our WordPress sites. This can be easily achieved by adding the following code on top of your WordPress site’s .htaccess file:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} folder
RewriteRule ^(.*)$ https://www.yoursite.com/folder/$1 [R,L]

But if you have many other rules in your .htaccess file chances are that you can break your site. Instead of adding the rule manually, you can use a plugin for making only specific pages through HTTP.

Author: wpbackend

Content creator at wpbackend.com

Leave a Reply

Your email address will not be published. Required fields are marked *