[thesite] mod_rewrite trickery (was: What's appropriate for d.e.o.)

Simon Coggins ppxsjc1 at unix.ccc.nottingham.ac.uk
Fri Aug 17 10:55:14 CDT 2001

> > One other feature that's ready to add is "friendly" urls, but it needs
> > mod_rewrite installed before I can add it. Does anyone know if
> > mod_rewrite is installed and available using .htaccess files?
> Oh, doing it with mod_rewrite? Interesting, how are you doing that
> then? I've got a little hand rolled function here for doing the same
> thing with $REQUEST_URI.

At the moment the subcategories are loaded using the url variable viewCat
which just passes the category ID. Instead of this:


I would like to show this:


using mod_rewrite the actual location of the page would be:


I've written a function that will convert this url string back into a
catID, and another one to take a catID and create the url string (which is
used for building links).

Now you can do a similar thing using $PATH_INFO, or $REQUEST_URI but as
far as I know you would still need to include the filename like this:


which I would like to avoid. I know you can fiddle with the types a bit to
get something a bit nicer like:


but I'd rather exclude that extra level all together if possible.

If you know of any way of doing what I'm trying to do with $REQUEST_URI
then that would be great!


More information about the thesite mailing list