this is my first question on ServerFault and I think I couldn't find a similar one.
To the point. I would like to achieve the following using my .htaccess.
subdomaina.example.com/stats/ -> subdomaina.example.com/subdomaina/stats/
subdomainb.example.com/stats/ -> subdomainb.example.com/subdomainb/stats/
subdomainc.example.com/stats/ -> subdomainc.example.com/subdomainc/stats/
Subdomaina,b,c and test.com need to be dynamic and not static.
I know that I should be using the mod-rewrite but I am a bit confused.
I quite unexperienced with apache and .htaccess, so any pointers, clues, and explanation is greatly appreciated.
(.*)\.example\.com$with$at the end will match all paths (example.com/test and example.com/stats). But I would only like to match stats and this is the part where I am stuck. – Jimmy Kane Mar 06 '14 at 10:50/statspath. – Andrew Schulman Mar 06 '14 at 10:54RewriteRule ^stats/(.*) /%1/stats/$1 [R]– Jimmy Kane Mar 06 '14 at 11:53