Re: Rewrite Voodoo pt. 2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 26-Jan-10 19:41, Eric Covener wrote:
On Tue, Jan 26, 2010 at 6:12 PM, Reese <howell.r@xxxxxxxxxxxxxxxx> 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-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux