ocon - 3:55 am on Aug 24, 2013 (gmt 0)
I know this is pseudocode, but is it possible to create something like:
RewriteRule ^name/((.)(.?)(.?).*)/$ /cache/$2(/$3)(/$4)/$1.html [QSA,L]
Where (/$3)(/$4) only populate on the right side if it matched something on the left? I know the third and fourth parenthetical sets on the left are optional since they are flagged with the question mark and therefore would be null on the right if they don't match anything, but I only want them to insert the subdirectory slash on the right if they do match something.