One comment about the above code.
The multiple (.*) patterns will slow your server to a crawl. The first (.*) pattern will match ALL of the remainder of the URL request and the pattern-matching will have to back off and retry hundreds of times to find the correct match. It will then have to do the same again when the next (.*) pattern is encountered, then again for the next one. The parser might have to try tens of thousands of possible matches before it finds the right one.
Change all of the (.*) patterns to instead be those that can be read left-to-right in a single pass. Something like ([^/]+)/ might suffice in at least one case. Others might be ([a-z0-9]+)/ or similar.
The will massively improve server efficiency.