On 26-Jan-10 19:41, Eric Covener wrote:
On Tue, Jan 26, 2010 at 6:12 PM, Reese <howel...@inkworkswell.com> 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.

Obviously I'm still missing something, because that just looks borken
to me. But, at this juncture I will rise up from my lethargic backside
and do some testing on a server - one where if it backfires on me, it
won't take live pages offline.

If you were local to me, I'd offer you a cookie. Chocolate chip, fresh
from the oven. It's hard to beat "fresh from the oven" from a cook who
knows how to sautée garlic w/out burning it - and can make Julia Child's
boeuf bourguignon successfully and repetitiously.  ;)
I need more exercise - of the physical kind. :(

Reese




---------------------------------------------------------------------
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: users-unsubscr...@httpd.apache.org
  "   from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org

Reply via email to