[thelist] Mimicing a "normal" directory structure with mod_rewrite

April april at farstrider.org
Sat Jul 9 04:50:39 CDT 2005


Hello all, hope you're having a good day.  I think what I have is a 
regex question here

I want to use mod_rewrite in a web directory so I can mimic a natural 
directory structure like category/subcategory/subcategory/ while 
overlaying one file like categories.php.  I'm fine just doing category/, 
but I can't figure out how to deal with the /'s between subcategories 
and the fact that they might or might not be there.  IE I can do:
RewriteRule ^dir/([A-Za-z]+)$ category_view.php?cat=$1
but I can't figure out how to adjust it to deal with a url like:
http://domain.com/dir/Games/Flash/Free

Any help or pointers in the right direction would be greatly appreciated.


More information about the thelist mailing list