I have a URL that looks like this
http://www.example.com/dir1/dir2/prodid.123456789
but /dir2 and /dir2/prodid.123456789 don't always have to exist. The following 3 rewrites have been tested and work to rewrite the new URL's back to the old filepaths
RewriteRule ^([^\./]+)/([^\./]+)/([^/]+)$ /cgi-bin/store/$1.cgi/$2/$3 [L]
RewriteRule ^([^\./]+)/([^\./]+)$ /cgi-bin/store/$1.cgi/$2 [L]
RewriteRule ^([^\./]+)$ /cgi-bin/store/$1.cgi [L]
I'd like to consolidate them if it would be more efficient, would this be the best way to accomplish that?
RewriteRule ^([^\./]+)([^\ ]+)* $ /cgi-bin/store/$1.cgi$2 [L]
I also think I could use (.*) instead for the second part, but I keep reading how it is best not to use it under various situations. Would that also apply here?
Thank you!