david galbraith's weblog david galbraith's weblog

October 27, 2006
[ Home ]

my recent wists expand »


Universal Mod Rewrites

This mod re-write strategy seems to fall into the 'duh why didn't I think of that' category of really simple but perfect solutions.

People use mod rewrites to trick google into indexing stuff create pretty urls.

Rails and a bunch of other frameworks force a grammar for links based upon actions and data when really most of the time there is no distinction made, there are just name/value pairs passed to the url. e.g. color=red is no different from colorit=red.

The strategy below loops through name/value pairs as url query string parameters and actually spits out the name and the value in the url:

site.com/name1/value1/name2/value2.

There are some potential problems with null values and ordering, but I like the idea.


Create Dynamic URLs With Mod_Rewrite and PHP Functions by www.Shadow-Fox.net


bio in FOAF »
this in xml »
(rss 1.0)
(rss 0.91)
my Wists »
one line bio »
<olb> Scottish, based in New York, former architect at Foster and partners, founder Wists, co founder: Moreover, co founder: the Origins Network, co author RSS 1.0 </olb>
other projects »

view postings by category »
archives »
meme machines »

others »