3 min read
301 Redirects for Happier SEO

by | May 20, 2020 | KBs, Software | 0 comments

SEO and 301 redirects

Optimize your 301 redirects for SEO

If you host a WordPress site and use the Really Simple SSL plugin for SSL detection and configuration, you may have a less than optimal setup for SEO purposes.

Really Simple SSL default setup

The .htaccess redirect method is not enabled by default since it can cause problems with some configurations but is recommended when possible since it’s generally a faster redirect than using Javascript or the WordPress 301 redirect. Once enabled, the plugin recommends the following .htaccess changes to redirect HTTP requests to HTTPS for your domain:

Really Simple SSL default 301 redirect configuration

This gets you a lot of the way there because it ensures that anyone who visits your site will always do so using a secure HTTPS connection. It does, however, introduce two potential SEO-impacting issues.

Problem: Multiple 301 redirects

The specified rules cause a 301 redirect chain. Having too many redirects reduces page speed and authority. 1:1 redirects are preferred, but you end up with two hops per request given the provided rules. You can test this for your own domain using httpstatus.

Multiple 301 redirects

Problem: Duplicate (non-canonical) URLs

Search engines like Google see www and non-www URLs as separate URLs pointing to duplicate content. In other words, https://www.aurorafoundry.com/blog/ and https://aurorafoundry.com/blog/ get crawled as two different pages, containing the same content.

I guess this is because Google refuses to acknowledge the age-old standard that www is not like other subdomains ¯\_(ツ)_/¯. But in any case, by not having a canonical URL for any given piece of content, you’re leaving it up to the search engines to decide. Google tries to infer this automatically, but you can end up with link juice split between different versions of the exact same content. You’ll also see a lot of extra noise in the search console and in many SEO analysis tools if you don’t address this with proper server-side redirects for your www URLs.

Cross Domain Canonicals

Solution: Better .htaccess rewrite rules

By modifying your .htaccess with the following rewrite rules, you’ll redirect the entire domain from non-www to www and HTTP to HTTPS, with only a single 301. This will also clear up canonical issues with www vs non-www URLs.

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\. [NC]

RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{HTTP:X-Forwarded-Proto} !https

RewriteCond %{HTTPS} off

RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

</IfModule>

More from Aurora Foundry

Relief for Innovative Startup Endurance

Relief for Innovative Startup Endurance

Aurora is proud to announce the RISE Award, which offers a free provisional U.S. patent application or $5,000 towards a non-provisional U.S. patent application to a selected applicant.

AWS from 30,000 ft

AWS from 30,000 ft

The web is full of resources talking about AWS, but coverage is incredibly fragmented. This is the single, curated AWS overview that I wished I had when getting started with cloud computing and Amazon Web Services. My hope is that it will serve as a conceptual getting started guide for developers, managers, and executives looking to get a more holistic understanding of how all of this tremendous power and flexibility fits together.

Remote Toolkit – A Guide to Working from Home

Remote Toolkit – A Guide to Working from Home

The COVID-19 crisis has triggered a tsunami of folks working from home. This has spurred a ton of questions from friends, family, and not yet liberated former colleagues about remote work. As someone who’s been an IC, senior executive, and now co-founder of distributed companies, I have some thoughts.

Related Topics

0 Comments

About the Author

Josh Sloat is the co-founder of Aurora Consulting. He lives and works remotely from Northern Michigan. Josh has been developing software and leading cross-disciplinary teams for the past two decades, with broad-ranging experience in mobile, web and desktop technologies. When he’s not solving first-world tech problems, he spends his time as a domestic engineer (loving father and husband), avid backcountry adventurer, and aspiring landscape photographer.