How I Learned To Stop Worrying And Love the .htaccess File

16 September 2019

Posted in: BSEO

Roxana Stingu’s talk at BrightonSEO was centered on making the most out of the .htaccess file for SEO. Below you can find the key points covered during the talk and some actionable advice for managing your site’s .htaccess file.

Overview

What was the talk about?

Roxana wants SEOs to start making use of the .htaccess file and stop avoiding it. Yes, this is a powerful file and a mistake could potentially take your site down but, with careful changes and a little research, this file can be an extra resource for your SEO endeavors.

One quick way to optimise your .htaccess file is to simply tidy its data. The amount of data in this file can impact time to first byte (this was tested by adding a tonne of page-level redirects to the file). Instead, use the mod_rewrite module to create domain-level redirect rules.

Another handy hack included in Roxana’s talk was setting a canonical for non-HTML pages. This can actually be achieved by using the .htaccess file. For example, if you have a PDF and an accompanying sales/explainer page promoting the PDF then you can set the PDF’s canonical to the sales page, making use of any link equity.

Potential impact on the industry

The .htaccess file is something that’s often left to developers to manage. With a little research and understanding, SEOs too can make use of this file and use it to support wider SEO efforts. The key point is to learn how to make changes to this file before jumping in.

Key takeaways

  • Use the .htaccess file to clean and manage your redirects.
  • Data within the .htaccess file can impact time to first byte (therefore it can be useful for speed optimisation).
  • Page level redirects are often left as HTTP rules with a lazy site-wide redirect that then tells the server to redirect to https. This creates an unnecessary redirect chain.
  • Use it to set canonicals for pages that don’t use HTML.
  • Try to avoid conducting live .htaccess changes on your site, test your updates first.
  • Learning to use the .htaccess file without dev help will help you bolster any SEO efforts.
Share This