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.

-- 
Eric Covener
cove...@gmail.com

---------------------------------------------------------------------
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