On Tue, Jan 26, 2010 at 6:12 PM, Reese <[email protected]> wrote:
> RewriteEngine On
> RewriteCond %{HOST_HTTP} (www\.)?domain.ext
> RewriteRule ^/(string1)/(.*)$ $2\.domain\.ext/$3 [R=301,L]
>
Much closer to being reasonable.
You have more backreferences ($1, $2, $3) then you have captures. You
probably want something closer to this
RewriteCond %{HTTP_HOST} (www\.)?domain.ext
RewriteRule ^/(subdomain1|subdomain2|subdomain3)/(.*)
http://$1.domain.ext/$2 [R=301,L]
Which fixes a few other nits (variable name transposed, prefix
redirect with protocol)
I explicitly listed subdomains/subdirs to avoid capturing subdirs of
the docroot that don't happen map to other domains.
--
Eric Covener
[email protected]
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [email protected]
" from the digest: [email protected]
For additional commands, e-mail: [email protected]