UPDATE: NorthantsLive re-loaded!

1Jack14th Jul 2008Blog, , , ,

Recently I have re-written my online directory www.northantslive.co.uk in PHP and I hope to release it soon as an Open Source project. Starting from scratch, I entered all the information into a mySQl database and deleted all the old .html files. The whole site now uses just three .php files (index.php, category.php and listing.php) and some template files to create the entire website.

“PHPmyDirectory” (a working title – I have since found someone else using it!) is presently still in beta and so I have been adding a lot of new features. Most recently I added templates so that the 3 different instances I have running (see links below) can all look slightly different. A config file allows you to select the template to use and to change a number of labels throughout the site (like title, keywords etc).

Splitting the data, templates and scripts apart allows me to work on single elements at a time – simplifying the development process. It also allow me to upload the latest script across all three instances without affecting the individual styles.

Finally, because the whole purpose of these sites it to get into the Google rankings, I have used the Apache mod_rewrite to make some nice friendly URLs. This was surprisingly simple to implement and means that to Google and the visitor, my site appears to have hundreds of .html pages, not just 3 .php ones! Cool, eh?  it also means that the same content can dynamically appear under more than one category without having to duplicate it in the database

With mod_rewrite:

  • http://www.northantslive.co.uk/category.php?catoid=4 becomes http://www.northantslive.co.uk/directory/computers
  • http://www.northantslive.co.uk/listing.php?id=7&catoid=4 becomes http://www.northantslive.co.uk/directory/computers/7/townsweb_archiving.html
  • http://www.northantslive.co.uk/listing.php?id=7&catoid=5 becomes http://www.northantslive.co.uk/directory/building_services/7/townsweb_archiving.html

Next step is to dynamically create keywords and descriptions based on the content from the database.  Any other ideas are welcome, too! Although it’s not ready yet, soon I hope to release it so others can work on the code too. Anyone interested should obviously contact me.

Present instances:

1 Comment Comments Feed

  1. Jack (July 14, 2008, 8:47 pm).

    UPDATE: New name is “phpLinkbox”. Please post any better ideas!

Add a Comment