WP Snipp Ninja

How to make one hop HTTP to HTTPS 301 redirect on CentOS Web Panel (CWP) Environment?

Author: Dimitar Radev | Posted on: September 15, 2020 |

Redirecting WWW and non-WWW HTTP URLs to the final HTTPS location with one hop (also called site-wide redirect chains) is important for Search Engine Optimization for a few reasons:

  1. Link authority is lost – Every redirect reduces the Link authority. It’s just a bit according to Search Engine Land but we are trying to get every bit of optimization possible to be ahead of the competition.
  2. Google Bot will most likely stop following redirects after the 4th or 5th hop.
  3. Crawl budget is lost – Every redirect reduces the crawl budget.

From the user standpoint, the site will also appear to load faster if you clean up the hops on redirects coming from the non-canonical versions of your domain.

The two snippets below are used on CentOS Web Panel (CWP) Environment. Make sure to place them on top of your main .htaccess file.

HTTP to HTTPS 301 redirect to WWW

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.wp-snipp.ninja/$1 [R=301,L]

HTTP to HTTPS 301 redirect to non-WWW

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://wp-snipp.ninja/$1 [R=301,L]


About the Author

 Dimitar Radev

Hey, I'm Dimitar "B1-0S" Radev or D in short. I'm a WordPress Developer for nearly 10 years and I have in-depth knowledge in creating Custom WordPress Themes, Plugins, Commercial Themes Edits, and WooCommerce Storefronts. In the last two years, I'm specializing in Technical SEO for WordPress websites.

Follow Dimitar Radev on Social Media

Leave a Reply

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

  • Adam Hooper says:

    So this will solve redirect hops correct ?