SEO Advice for Apache Servers

SEO Blog, Videos 2nd Aug 2011

Hi, I’m Mike Essex, the Online Marketing Manager at Koozai. Today’s video comes from David Sottimano from Distilled. David asks, “What are the best ways to do SEO for Apache servers?” So I’m going to run you through three simple ideas. Now, Apache is a very complicated beast so there’s certainly a lot more than these or some more high end technical solutions, but for a basic introduction on the things that anyone with a little bit of development time can do, these are essential things that you should be doing.

So the first one we’ve got is .htaccess, this is the most powerful part of Apache in my opinion. What you can do is a lot of the basic kind of 404 errors can be fixed within here. For example, you can state your 404 page URL within here and design your own custom page. I tend to do that with links to other pages on the client site so people can find their way back to the content they want, rather than just a general 404 page, which is just, ‘Page not found, figure it out yourself.’

So first of all we’ve got 404. Then you’ve got your 301 redirect, so ideally we don’t want people to see a 404 page. We want them to be redirected to the right content. So you can build 301 redirects into Apache. It’s really simple. You just write, ‘301 redirect’ then you put the old URL without the domain name. Then after that, you write the new URL with the domain name, simple. The way that I tend to do this is to build in Excel, so that I have one column that just says, “301 redirect,” another one with the old URL, and another one with the new URL, and that’s good because sometimes there tends to be a pattern in the way the old URLs were and the new URLs are. So you can create some macros in Excel to do that quickly. It’s not essential. You don’t have to do it that way. You can just write on the .htaccess file. It’s just a basic text file that you add in there, but for me it’s a real time saving solution to do it that way.

Next, you’ve got your canonical homepage issue. So if the client’s site homepage exists at domain/ and also at index.htm, index2, index.php, all sorts of annoying variations that clients like to use, you can just set in this file what the index should be and tell it to point these other variations to it. So it’s like a 301 redirect, but it’s just written in a slightly different way.

Another duplicate issue that you can have is duplicate domains. So, for example, we’ve got, but we’ve also got We don’t want two separate websites to exist on those two different domain names or the same website to exist on both. So we always want the URL bar at the top to say We set that in here, so canonical, homepage, and domain. So not only can you resolve the duplicate homepage in here, you can also specify what it is with this tag as well.

So that’s the .htaccess file. One last thing that you can do as well is to change file extensions from one to the other. So, if you change your entire site from HTM to PHP, you can set that in here to automatically point one to the other.

In the .http config file, this is the place that I tend to use to redirect URLs that have different case variations. So if your client URLs can exist as uppercase and lowercase URLs, but ultimately it’s the same webpage, then you set that in here and say actually I only want them as lowercase all the time and just redirect everything else.

Last of all we’ve got Gzip compression, which technically you do put in an .htaccess file, but I’ve included it as a separate component here because it’s kind of different logic to redirects. With this, you can tend to save up to 70% of the site load time just by the way this zips files on the fly. The user doesn’t see any difference, apart from the speed, but it makes things faster for them and for the search engines. It literally is just one piece of code. You can find it easily just by searching for Gzip compression. You just plug it into the .htaccess file, upload it to the server, and you’re done.

So those are the main components. All I would suggest with any of these is to do them step-by-step. So to do your 404 page, add it, test it. If it doesn’t work, upload the same version again. If you do get any of these files wrong, it will bring down an entire client website, but it’s simply just a case of uploading the old file again. So just bear that in mind, be really careful. Make sure you check all your redirects afterwards, because the last thing you want to do is redirect a client’s store page to their homepage or something daft like that.

So follow these steps and you’ll really be able to harness the SEO potential of Apache. If there’s anything we’ve missed in this video, then let me know by visiting or subscribe to our videos to get more updates like this.

What do you think?

Latest Videos

Aspect Ratio Fix

Stacey Cavagnetto

How To Write Better Blog Content

Aspect Ratio Fix

Kelly-Anne Crean

How to use the TRIM function in Excel


Digital Ideas Monthly

Sign up now and get our free monthly email. It’s filled with our favourite pieces of the news from the industry, SEO, PPC, Social Media and more. And, don’t forget - it’s free, so why haven’t you signed up already?

Download Your Free Whitepaper

Fixing Website Redirects and Canonical Issues


Call us on 0330 353 0300, email or fill out our Contact Form.

Map of Hampshire Digital Marketing Agency
Hampshire Digital Marketing Agency
Merlin House 4 Meteor Way Lee-on-the-Solent, PO13 9FU, UK
Map of Lancashire Digital Marketing Agency
Lancashire Digital Marketing Agency
Cotton Court Business Centre Church Street, Preston Lancashire, PR1 3BY, UK
Map of London Digital Marketing Agency
London Digital Marketing Agency
Albert House 256 - 260 Old Street London, EC1V 9DD, UK

Unlike 08 numbers, 03 numbers cost the same to call as geographic landline numbers (starting 01 and 02), even from a mobile phone. They are also normally included in your inclusive call minutes. Please note we may record some calls.

Circle Cross