Hi everyone... just wondering what I might add to a .htaccess file to accomplish the following: someone visits: /folder-name/ rewrite to: /index.php?page=folder-name someone visits: /folder-name/subfolder-name/ rewrite to: /index.php?page=subfolder-name I figured out a way to do it using a text file as a lookup but I have a feeling that isn't necessary... my guess is that the above can be accomplished with just 1 (maybe 2) lines added to .htaccess. Also, can it be written in such a way where "/folder-name/subfolder-name/" would be equivalent to "/folder-name/subfolder-name" ... or is that the default behaviour anyway? Thanks! ~Keith
Figured it out... just used this: RewriteRule ^([a-zA-Z0-9_-]+)$ /index.php?page=$1 RewriteRule ^([a-zA-Z0-9_-]+)/$ /index.php?page=$1 RewriteRule ^([a-zA-Z0-9_-]+)/index\.php$ /index.php?page=$1 RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ /index.php?page=$2 RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/$ /index.php?page=$2 RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/index\.php$ /index.php?page=$2 I used 6 lines to cover all bases but 4 would have been sufficent, 6 might be overkill...