Archive for the ‘Seo & Marketing’ Category

Getting to number 1 in Google: An SEO case study

To try and increase sales and awareness at the JJB Sports website, I set about optimising the site for search engines and customers. The major success story was getting the site to the number 1 spot in Google (UK) for the keyword “nike trainers“. Here’s how I did it:

Read the rest of this entry »

Proof that little design changes can make a big difference to conversion

A month ago I wrote that little design changes can make a big difference to conversion and now here’s the conclusive proof.

Read the rest of this entry »

What is Search Engine Optimisation and how can it be achieved

The concept of good SEO is for your website to appear well in the natural rankings of Google/Yahoo/MSN/etc as opposed to the paid for listings (which cost money and don’t perform as well). There are 2 ways you can do this:

  1. Create a good website full of good content/products at good prices
  2. Construct your website in such a way that works well for search engines

Read the rest of this entry »

Creating People friendly URLs using PHP and MYSQL

Let’s face it people, URLs need to be people and search-engine friendly; People need them as navigational aids and search engines love those keyword-laden pieces of loveliness.

The challenges involved

It can be difficult to have a URL that represents the page title and fits in nicely without any <span>20 or random characters e.g. £</span>*&.

My favoured solution is to convert a page title into a URL friendly format and store it in its own field in the database. NB I don’t use it on this site but, Textpattern (which runs this site) does use a similar thing: e.g.


People friendly URLs using PHP, MySQL and mod_rewrite
becomes
people_friendly_urls_using_php_mysql_and_mod_rewrite

Here’s How

When creating a new page, be it a blog article, or a piece of news or whatever, I’ll give it a title and then just before uploading it to the database I’ll run it through a function that removes any nasty characters, then when I upload it I use two separate fields title and title_html.

the PHP

The function looks like this:


function create_url()
{
global $url;
$url_searches = array(” “,”á”,”â”,”ã”,”ä”,”Ã¥”,”æ”,”ç”,”è”,”é”,”ê”,”ë”,
“ì”,”í”,”î”,”ï”,”ò”,”ó”,”ù”,”ú”,”û”,”ü”,”fuck”,”shit”,”bollocks”,
“cunt”,”twat”,”tit”,”cock”,”dick”,”_-_”,”(”, “)”, “*”,”&”,”‘”,”!”,”%”, “/”, “?”,”£”,”$”,”%”, “,”);
$url_replacements = array(”_”,”a”,”a”,”a”,”a”,”a”,”a”,
“c”,”e”,”e”,”e”,”e”,”i”,”i”,”i”,”i”,”o”,”o”,”u”,”u”,”u”,”u”,”f—”,”s—”,”b——-”,
“c—”,”t—”,”t–”,”c—”,”d—”,”_”,”", “”,”",”and”,”",”",”",”",”",”",”",”",”");
$url = strtolower($_POST[’url’]); // turn url into lowercase
$url = str_replace($url_searches,$url_replacements,$url); // create browser-friendly url from title
return;
}

This code is far from perfect, as I am not a PHP expert. I invite people to improve this as it would be easy to do so.

Using it in the page

When the page is called a MySQL script grabs the webpage based upon that title as long as it unique e.g:


SELECT * FROM articles WHERE title_html = $_GET['title'];

It may be that you don’t even use the title to get the page, you may have an id or other variable in the URL that is used and the title is just for show. Either way, this is a technique that works and gets both peopel and serach engines to use your URLs effectively.

Alternatives

The other option, as I see it, is to run the function everytime on the site whenever you link to the page within your site eg:


<a xhref=”/folder/link<?= create_url($row[’title’]); ?>”>link text</a>

This is not the method I’d recommend as it adds more things to think about and more code throughout your pages.

Phil Thompson

<img />... is the online home of Manchester web designer / web developer Phil Thompson.


Search

Recent work

A mini-update of recent work.

See my portfolio for more work