mod_rewrite fun

Robby Russell <[email protected]>
Newsgroups gmane.org.user-groups.linux.pdxlug
Organization PLANET ARGON
Message-ID <1088828934.20955.15.camel@vacant>
Hey all,

I am trying to create a friendly mod_rewrite rule that will do the
following.

http://mydomain.com/level1/level2/level3/

RewriteRule ^(.*)/(.*)/(.*)/$
index.php?level1=$1&level2=$2&level3=$level3

I can get it to work at if I have all 3, but if I only go to:
http://mydomain.com/level1/  it doesn't work. How can I make this be
flexible? If it's only one // deep, then go to level1=$1 ///
level1=$1&level2=$2, etc...

I'll keep looking through the docs, but if someone can throw me a quick
link and/or example, that would be much appreciated.

Cheers,

-Robby

-- 
Robby Russell | Owner.Developer.Geek
PLANET ARGON  | www.planetargon.com
Portland, OR  | [email protected]
503.351.4730  | blog.planetargon.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.