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:


The desired subdomain set up would therefore look something like this:


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:


which obviously doesn't work.


  • If I remove the [P] flag, the rewriting works correctly. (i.e. the request ends up looking something like my-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?

1 Answer 1


Whilst I don't completely understand why it works, we do have a solution that works, so I thought I would post it here.

The rewrite rule now looks like this:

RewriteRule ^(?:group)?(.*) http://my-domain.com/group/$1 [P]

which correctly redirects as expected.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.