George’s Wonder Blog

Just another WordPress weblog

Good URLs - Future Proof your website

February 8th, 2008 by George

I’ve been involved in several web projects where we’ve rewritten an html site in asp or php. Your page names will change from whatever.html, whatever.htm, or whatever.shtml to whatever.asp or whatever.php - right? You can opt for this but there are workarounds that may be practical. For example, if your host company allows it you can instruct the server to treat your html, htm or shtml pages as if they are asp or php pages. Here’s a quick example from an asp site was rewritten in with php. The decision was made not to rename the pages with the php extension but instead to leave page names unchanged (like whatever.asp) but have the server treat the pages as if they were php pages. The following was added to the site’s .htaccess file:

## Make all .asp file act like .php
AddHandler application/x-httpd-php .asp

## Make sure the server knows which pages are index pages
DirectoryIndex index.asp default.asp index.html index.htm index.shtml index.shtm

The first line is a comment and the second line tells the server to run the php code in asp pages. Skipping the empty line, the third line of code is another comment, and the fourth line of code tells the server which files are index files. [For more on DirectoryIndex read about Apache mod_dir or try googling the term apache mod_dir.]

Good planning can save you time, money and your audience.  Check out these thoughts from W3C’s Hypertext Style: Cool URIs don’t change page into consideration when you are deciding how and if you should change your page names:

QUOTE 1:

In theory, the domain name space owner owns the domain name space and therefore all URIs in it. Except insolvency, nothing prevents the domain name owner from keeping the name. And in theory the URI space under your domain name is totally under your control, so you can make it as stable as you like. Pretty much the only good reason for a document to disappear from the Web is that the company which owned the domain name went out of business or can no longer afford to keep the server running. Then why are there so many dangling links in the world? Part of it is just lack of forethought.

QUOTE 2:
We have so much material that we can’t keep track of what is out of date and what is confidential and what is valid and so we thought we’d better just turn the whole lot off.

That I can sympathize with - the W3C went through a period like that, when we had to carefully sift archival material for confidentiality before making the archives public. The solution is forethought - make sure you capture with every document its acceptable distribution, its creation date and ideally its expiry date. Keep this metadata.

del.icio.us Digg Facebook Technorati StumbleUpon Bloglines Ask

This entry was posted on Friday, February 8th, 2008 at 7:26 pm and is filed under SEO-SEM. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply