I've created a RewriteMap to handle a large number of domain proxies. My rewrite conditions looks like this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ - [E=MAPTO:${rewritemap:%1}]
RewriteCond %{ENV:MAPTO} !=""
RewriteRule ^.*$ http://exampledomain.com/%{ENV:MAPTO}/$0/ [P,NC]
</IfModule>
Basically, my RewriteMap will look at the domain coming in, match it to an entry in a database, and return something like "user/userid".
This would, for example, display the incoming domain in the address bar, but display the content returned at http://exampledomain.com/user/userid/
Now, for some reason, I'm getting a 301 redirect to http://exampledomain.com/user/userid/ — no proxy. What could be causing this?