URLs for SEO

Published on: 27th March 2008

URLs, Titles and SEO - Technical Tricks

When I am asked to review sites and their SEO, one of the first places to look is at the top.  The title bar, and the URLs within the site.  This article discusses what can be done in a site (programming wise) to improve the site's worth to the search engines.  These methods are mainly used for enhancing database driven sites, such as e-commerce shops or content managed sites, but can be used to some extent with standard HTML sites too.  I'll warn readers now; this may get technical!

The Title Bar.

At the top of (hopefully) all documents, there are the head tags.  You will see:

<HTML>
    <HEAD>
        <TITLE>This is the title</TITLE>
    </HEAD>
    <BODY>
    Rest of document....

There will likely be other things in there like keywords, character set definitions etc, but I want to focus on the Title tag.

It is VERY COMMON to see a web site with the same title on page to page.  Sometimes people will add words like 'About our company', or 'Contact us'.  Since it is my belief that the title is the first thing that any engine will read and take seriously, it is vital to place the correct words to categorise the page's content in there.  Anything less is missing a trick! 

Notice how on this page, the title of the article is the title of the page?  This is not as hard as it seems with some programming knowledge.  On many sites that I do, I make sure that a string is put together from whatever resources are available and that is placed in the title section.  A script would look something like this:

 

 

<?PHP or ASP SCRIPT
    (Connect to database to retrieve information relevant to page and place result in $pageinformation);

    if(!empty($pageinformation)) {  
        // I.e. no information could be found      
        $titlestring="Information about my business in general';
    } else {
        // Information found
        $titlestring ='Myweb.com - ' . $pageinformation;
    } 
?>
<HTML>
    <HEAD>
        <TITLE><? echo $ titlestring; ?></TITLE>
    </HEAD>
    <BODY>
    Rest of document....

 

Obviously this script is pseudo-script, but looseley based on PHP.  This one bit of work makes sure that if information specific to the page is found (i.e. a product description or article title) then this information is formatted and 'injected' into the page title.  It may seem like hard work, but consider, one bit of code and potentially thousands of pages could be instantly given sensible and very specific titles:  Google and your customers will love you as it will be much more likely that a specific search term will match a single or group of pages on your site, which has 2 great benefits:

  1. Effectively increases the SEO footprint of your site

  2. Encourages alternative entry points, so customers land in your site on the most relevant page automatically, shortening their journey.

URLs

With data driven sites, or even sites that use basic selection and forms, I often see GET queries that are likely to obstruct search engines.  I.e.

http://www.ginzola.com/index.php?page=menu-seo  is a link within the site, but you will not find me using it!  Instead it is reformed to: http://www.ginzola.com/index.php/page/menu-seo

The second URL produces an identical result to the first page, yet the URL is quite different, and likely to be seen differently by a search engine in some cases.  There are broadly 2 ways to achieve this optimisation:

Mod rewrite

Recent Apache server releases come with a module that converts '/' based data into GET query data.  This can optimise your site with relatively little coding change.  The only thing you will have to be careful of in this case is to make sure that all the links are not relative to the page.  I.e. if you use the code:

<img src="../images/foo.jpg>

Then this will fail if the web server is presented with a string with '/' encoded GET variables.  Instead, all links must be formed thus:

<img src="/images/foo.jpg>

i.e. a path relative to the root, and not the document!

For situations where a mod rewrite is not possible (as is standard unfortunately), exactly the same can be achieved with good coding...

A function in the header of a document can iterate through the current URL and create variables for all the GET strings it finds.  This really is a very neat way of doing this as it guarantees that the code will work on any server that supports the language in question.  All the paths to images, css sheets and links will need to relative to the root and not the document as shown above.  This method is used as standard within the Ginzola content management system.

Conclusion

It has been shown here that some clever analysis on information that is available within a site, and some coding can greatly enhance a site's search engine representation by introducing structured variety within the site's pages coding.  Ginzola.com reviews sites regularly and implements such changes either independently or in conjunction with an existing web designer. 

In every case, where TITLE and URL information is unstructured or lacking variety, this sort of review has yielded measurable results for Clients, and I have no doubt that these methods will continue to work in the future.