On Thu, Jul 24, 2008 at 5:12 PM, Mike Miller <mbmiller at taxa.epi.umn.edu> wrote: > > The pattern above: > > ^(.*?)/*?$ > > My pattern: > > ^(([^/]+?/)*[^/]+)/*$ > > There are three differences: Mine will not match a line that begins with a > slash "/" but yours will match such a line. Mine requires that at least one > non-slash character be present but yours does not have that requirement. > Mine clearly drops the final slashes (the "ambiguity" issue I mentioned > above that is handled by dropping the second question mark). > > I was just basing mine on what you had earlier. > > Mike Thanks Mike, Your clear explanation has really helped my meger understand regex. Yours is clearly much better. If anyone is interested in a similar solution this seems to be working well. I'm mapping user defined page slugs to any page in the site using a slug map this must go in the conf file. mine is in the <VirtualHost ...> RewriteMap txtmap txt:/path/to/slugmap.txt once there, it can be referred to in .htaccess if you want but the RewriteMap itself can't be in .htaccess then the rewrite conditions and rule. the conditions prevent the rule from stomping on any real files or directories <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(([^/]+?/)*[^/]+)/*$ ${txtmap:$1} [L] </IfModule> then I manage the slugmap.txt from the web apps admin interface. Any page page can have any url as long as slug doesn't match a real url. thanks again Steve and Mike for your help. - Tom