Category Archives: SEO

Put Your 404 Page to Work with URL Splitting

If you launch a new version of a site and the URL structure changes – you can certainly handle most of that with an htaccess file and a 301 Redirect command. But sometimes, as I’ve found at least, this isn’t always the best solution because if some of the URLs have similar parts, your redirect rules can get confused and not behave as expected. Or perhaps your crappy web host doesn’t allow such things.

So instead of pulling your hair out, you can shift some of the burden off onto your 404 File Not Found page. You can make this a php page, and put something like this in your .htaccess file (assumes Apache 2 – I think Apache 1 is different):

ErrorDocument 404 /missing.php

Now, all our missing files and pages will be handled by missing.php – cool. So we can work some PHP magic to help people get where they need to go.

I use this following PHP code quite a bit. It takes the url and splits it into an array, w/o the domain:

$url = explode("/", $_SERVER['REQUEST_URI']);
if ($url[count($url)-1] == '') {
if (substr($url[count($url)-1], 0, 9) == 'index.php') {


Now we have our URL in an array called $url. So a URL like this:

Will create an array like this:

  0 => 'products'
  1 => 'category'
  2 =>'item'

So now, let’s say we changed the above url structure so that category part is no longer there, rather it’s this:

You can now do something like this in missing.php when someone hits the old, no longer valid url:

if ($url[1] == 'category') {
  header( "HTTP/1.1 301 Moved Permanently" );
  header( "Location: /$url[0]/$url[3]" );

What you’re doing here is sending the same kind of 301 redirect that .htaccess can, which lets search engines know this is the permanent new home for this page/file – and then shoots the engine/person over to that page. If the pattern doesn’t match, you should just have some html at the bottom of the page giving the visitor some sort of friendly message, and perhaps providing a link to the home page if you’re really courteous.


Narrowing Your Google Search Results

There are a few simple tricks that can help you narrow down what you are Googling for. Let’s just use an example and dive right in.

I’m looking for a band in Chicago called Sugar Beat. So, I start my search like this:


Hmmm… Even though I’m not looking for anything about cooking or food, I do need to trim the fat here.

By placing the words “sugar beat” in quotes, I tell Google that I am looking for this phrase – in other words, do not show me a page that contains sugar AND/OR beat – only return pages that have the words “sugar beat” right next to each other and in that order. Furthermore, let’s get rid of the word “sweets” – we do this by simply ending our query with “-sweets” – that’s a minus sign, and the word sweets (no space in between). This will help disassociate our search from pages related to food/desert:


This still isn’t perfect, but I think you’re getting the idea. One thing I want to point out here is that Google ignores punctuation – notice in the above example, that “… sugar. Beat…” turns up. So, if you are writing for search engines and need to use certain keyword phrases, keep in mind that you can use punctuation within your keyword phrase without risk.

Also, note that you can subtract more that one word from your query like this:

"sugar beat" chicago -sweets -cookies

So, if we can remove words from our queries, can we remove phrases? Yes, just put a phrase in quotes:

"sugar beat" chicago -"sweet tasty goodies"

And if we can subtract, surely we can add – right? You betcha – this next query will only return pages that have the phrase “sugar beat” along with the word music, but that do not have the word sweets:


Now we’re getting closer!  That first site listing looks interesting… Can I limit a search to just one website? Sure can:


By simply finishing our query with – we restrict our search to that site.

So, by simply altering our search query in some intuitive ways, you can find what you are looking for faster by either filtering out, or forcibly including, keywords & phrases into your search. I do this so much it’s become second nature – hope you find it useful too!

A Very Simple SEO Tool

Often I see articles in newspapers and magazines that tell you to “use keywords” and “refine text.” While doing these things is a very good idea, where is the best place to put your keywords? Or a better question might be, where is the best place to put your most important keywords?

Whenever somebody asks me how they can get more “organic”1 search engine traffic, the first things I look at are the Page Title and Heading 1 tags (<title> and <h1>). If they don’t exist, or if they aren’t being used well (“Welcome” isn’t a good main heading), it’s often the easiest way to improve.

The trouble is, sometimes what looks like a Heading 1 really isn’t. It could be a bold tag, or any other HTML tag that’s just styled to look like a heading 1 tag. Or worse, it could be an image masquerading as text. Search engines can’t read text that’s inside an image, or any sort of rich media like Flash. (And if you wrap your image in a Heading 1 tag, that still doesn’t count.)

Page Titles and Heading 1’s Are the Perfect Place for Your Best Keywords

Don’t cheat yourself out of potential traffic (not to mention clarity) by not using these tags to their fullest potential. Note that it’s the Page Title that shows up in search engine result pages (SERPs). Sometimes you hear people say that your website is somebody’s first impression of you/your biz, but often the first thing people see is your page title on a SERP. Make it clear and inviting to click. Got a sale going on? Let ’em know on the SERP, don’t wait for them to get to your site. Then bring it home with a good Heading 1 tag that assures people they are in the right place.

What I did here is create a simple online tool that will tell you what the Page Title and Heading One tags are on the provided page. The idea is to have something that slogs through the underlying HTML for you to see what’s really going on. I’ve been quite surprised with some of the results. For example, I’ve seen a website that uses a Heading One tag for every link in the menu bar, totaling seventeen of them when you should only use one.

For more detail, here’s relating article I wrote. And for excruciating detail, check out

Now let’s get started, and check a page!

1“Organic” refers to search engine traffic that happens naturally, as opposed to being paid for. On a Google SERP, organic results are in the main part of the page, whereas paid placement is located to the right and sometimes at the top of the page.

Google Documentary: Good vs. Evil

This morning I watched this very interesting documentary video on Google. Coming in at around 45 minutes, I found it very well done and engaging. If you are interested in not only the base methodology behind how Google search works (there’s a very good explanation of Page Rank in the first 7 minutes), but the questions that arise when one company is building an information monopoly. Is Google good? If so, will they always be good? For a company who’s insider slogan is Don’t be evil, only time will tell.


Interesting Read: Why Your Flash Website Sucks

While perusing my stats today, one breadcrumb led to another, and I came across this very interesting article by Matt Chisholm, Why Your Flash Website Sucks. In a nutshell, somebody created a Flash version of WordPress, and Mr. Chisholm lists off several reasons why this is a bad idea. I didn’t take this so much as a diss on this particular idea, but more as a general diss on all-Flash websites, as in, the website is nothing but a single Flash file.

The author hits several very good points, and has also stirred up a bit of controversy1. But the general points to consider when choosing Flash are:

  1. Search Engines cannot see your content very well. It’s true there are various ways to make your Flash content more searchable, but not really. Search Engines cannot determine things like page hierarchy (what the most important stuff is), or link text, or alt tags, etc.
  2. From the user perspective, unless the Flash developer knew what they were doing, you cannot select text. Even if you could, you cannot resize text unless the Flash developer added an aspect to the interface that allowed you to do that. Also, for the disabled that need screen readers or other assistive tech, Flash sites can be a nightmare.
  3. The general “slick” factor of an all Flash site wears out quickly for me. Not to mention that I cannot even bookmark the stuff I like unless, again, the developer developed his Flash app in a certain way, which most don’t.

So, to sum it up, Flash isn’t all evil. It can be very handy for dealing with media, such as an image slideshow, videos (a la YouTube), or playing music files. But don’t embed your primary content in Flash – rather, use it to ice the cake with.

1Sometimes, controversy is a great way to drive traffic to your site. Much like one band picking a fight with another (like Kanye and 50 Cent), the press drives sales, and in this case, traffic.