Chapters
Before you begin reading this guide I would like to share the short story of how it came into being.
What is the .htaccess file? Why use it for SEO? We will cover some of the basics in this section including other great resources.
Knowing when to use the .htaccess file is almost as important as knowing what you can do with it! Learn its valid uses and when you should use alternatives.
One of the favorite uses of the .htaccess file is creating redirects and mapping URLs. In this chapter I will cover the fundamentals needed to understand redirects.
In this chapter I will show you how to fix the three variations every URL can have (www, https, and the trailing slash) with a single redirect.
In this section I will show you how to set custom error pages. This will allow you to show valuable information instead of just sending the error response header.
Every SEO knows that speed matters. In this section, we will look at different ways to change your server configuration with the .htaccess file to make your site load faster.
Learn how to deploy the x-robot-tag HTTP header on your website to tell googlebot what it can crawl and index.
One of the great things that the .htaccess file can accomplish is setting canonical HTTP headers on static resources like images or PDFs. You will learn how to do so in this section.
In this chapter, you will learn what an SEO-friendly URL is, and how to solve common problems with .htaccess. I even explain how to convert your URLs to all lowercase.
Every site is unique. As such, I have written code to handle https, www, and the trailing slash in a number of different ways.