Basic principles of addressability for web applications:

  • Always tie your URL's to your data models.
  • Use mod_rewrite as sparingly as possible. It's too flexible.
  • Don't punish plurals - provide predictable redirects.
  • Go for human readable URL's if at all possible.
  • Provide namespaces for RESTian web services. Have an xml-based (e.g. rss) representation of every model in your application.

As always, delicious is a model of good design in this area. We're working at last.fm to improve addressability with what is a more complex data model (artist/album/track/label/user/tag).

"Use mod_rewrite as sparingly as possible. It's too flexible."

Can you explain what you mean by this, please?

The rest of your comments would require using mod_rewrite, in most cases.

anil says

The power of RewriteRule declarations can easily lead to inconsitencies in your URL's. It's good to get out of mod_rewrite and into a dispatcher object in your application layer as quick as is feasible performance-wise. Otherwise you'll easily end up with dozens, maybe hundreds of specific rules.

Look to Rails here, which only uses about 4 rewrite rules by default, and lets you configure routes in the application layer instead. It also has default routes built-in, so it favours convention over configuration in this regard. Working in the application layer forces you to think in object-oriented terms (in Rails' case in terms of controllers and actions) when thinking about routes, which will most likely result in paths that faithfully reflect your data model.

From Apache's mod_rewrite project page:

The great thing about mod_rewrite is it gives you all the configurability and flexibility of Sendmail. The downside to mod_rewrite is that it gives you all the configurability and flexibility of Sendmail.