Your .htaccess is kind of like the front door in your home or the directory you see once entering an office building. It helps you find the right path to the room you’re looking for, a direct route to the person you are visiting, or to navigate to the nearest restroom if you have to go. However, in many cases when it comes to SEO, .htaccess is more like the attic.
It’s where you store items you use once a year like holiday decor, things you don’t want to throw out, and all the junk which could land you a runner-up position on the show hoarders. When you have to open your .htaccess (much like an attic), you remember all of the things you’re supposed to do, but you put it off and let the clutter continue to pile up. That is where you run into a lot of SEO issues that can prevent your rankings from growing.
By not having a clean and direct .htaccess, you make search engines have to work to find the right pages and versions of your website. Think about showing up to an interview and being 10 minutes late because the directory was wrong, and the security desk kept giving you wrong instructions to find the HR team, then the administrative assistant sent you back downstairs to start over again. Now that you know what the .htaccess does for SEO, here is how we used this to increase a client’s positions from the lower part of page 1 in Google to the upper.
Our team is working with a client on SEO, and they have tons of content and backlinks, but their positions had plateaued and they couldn’t figure out why. It turned out to be a tech SEO issue with one of the big fixes being .htaccess.
During the first round of cleanup, we reduced the file by more than 1,100 redirects and instructions. We also reset other directives to properly point to the correct pages, or versions of the pages. From there we reduced redirect chains by stripping them out, and reset the options that needed to remain. This was only round one.
After this round of cleaning, the results helped the client to remove the stagnant positions, and get them to climb higher on page one. Often times your SEO will say you need content or backlinks, but that often isn’t true when you already have them, and the content is good.
In the screenshots below you’ll see current ranking positions in the columns (Google, Yahoo, Bing), and then the search volume for the keyword phrases. I pulled the report on 7/29/2019 with a comparison to the previous 30 days because I want to show the climb that happened once the pages and files were reindexed. The green number next to the ranking position is the amount of spaces it moved up. I used this tool to track, just like I do all clients. If you’re wondering why there are some with 0’s across, we haven’t launched those sections or the content yet. I add the tracking first so we can watch as it appears and properly monitor.
The niche is fairly competitive with lots of big money players. The goal was to move from the lower part of the first page to the upper, and this is the way we started the progress. Keep reading below to learn more about how .htaccess impacts SEO (without all of the other things it does). BTW, if you’re a programmer and yelling about the explanation above, don’t continue down. This post isn’t for you. It is for people like me in marketing, so I changed it to be non-techie for marketing teams.
How .htaccess Impacts SEO
Your .htaccess file is going to be big, scary, and complex. This is especially true for older sites which have had numerous designs, URL structures, and developers working on it. Knowing how to properly implement, test, and then retest is an art form rather than a science.
.htaccess files require a lot of patience and frustration, so if you’re going through a clean up, get ready. Here are some of the things that the programmer will be doing, looking at, and trying to fix.
- 3XX redirects – one of the main things that can be controlled are redirects. For this purpose it is to ensure that the person visiting your website always gets to the correct version of a page. This includes:
- secure versions when the end user hits a non secure http vs https
- www or non www
- all lower case URLs from upper case
- the removal of tracking parameters when someone reaches a page
- when you change or move a subdirectory to a subfolder
- if you change domains or URLs
- Uniform URLs – having uniform URLs can also be controlled by redirecting and setting them up properly in .htaccess.
- Redirect chains – Many times you’ll find previous instructions inside .htaccess that never got removed. One sends you to www, but the http version. Then another set of instructions takes the http and sends it to https. That is a basic example of how old directions create redirect chains. Redirect chains make it hard for Google bot to crawl through a website.
- 404 – When you hit a 404 page, .htaccess can show a custom design or better experience for you.
- Blocking crawlers – although you can get around it when .htaccess blocks your crawl, many robots and attempts to crawl and/or scrape your code can be stopped through .htaccess.
- Blocking users and people you don’t want – this file can also be used to prevent people from specific locations from accessing your content. They can get around it, but they’ll need to take extra steps.
There are more ways that .htaccess can impact your SEO, including site and page speed, but we’ll save those for a different post. This was a fun project to work on, and if you’d like my team to take a look at, audit, or work on your SEO, contact me through this page.