Background
We are trying to map a subdomain to a regular EE template group, without changing the URL.
Assume that the 'natural' URLs to the templates would look something like this:
my-domain.com/group
my-domain.com/group/url-title
The desired subdomain set up would therefore look something like this:
group.my-domain.com
group.my-domain.com/url-title
The rewrite rule we have set up on the subdomain looks something like this:
RewriteRule ^(.*)$ http://my-domain.com/group/$1 [P]
which, as I understand, will proxy the request to the 'natural' URL.
The Problem
The problem we are having is that by the time the proxied request hits the server, the /group
portion of the URL has been duplicated. So the request ends up looking something like this:
my-domain.com/group/group/url-title
which obviously doesn't work.
Debugging
- If I remove the
[P]
flag, the rewriting works correctly. (i.e. the request ends up looking something likemy-domain.com/group/url-title
). - I have tried using other segments after the domain in the rewrite rule, (just fake ones e.g.
/abc
) and the same thing happens with them.
Could there be anything ExpressionEngine is doing to handle / map a request which could be affecting a proxied request?