Making a Plugin work based on URL Location

You can do this by using the actions generate_rewrite_rules & template_redirect

more info can be found at http://wp-fun.co.uk/2007/12/24/creating-custom-urls/#axzz1dXkrd62P