Search Engine Friendly URLs with PHP

Nov 11, 2008 | Tags: SEO, PHP | del.icio.us del.icio.us | digg Digg

2. Give Each Article a Filename

It is obvious that if you want Search Engine Friendly URLs, you should assign a filename to each of your articles. Maybe it's something like:

final-war-of-the-roman-republic.html
Decline_of_The_Roman_Empire
Richard-1-of-England

You do this by adding a column to your article table:

filename VARCHAR(45) NOT NULL

Also add an entry box in your article form for this field. When you're writing a new article, fill this field with the filename for your article. Note that this field should be unique. A filename cannot be assigned to two or more articles.

Later you can refer your article with http://yourdomain.com/Decline_of_The_Roman_Empire, for example.