Mike Miller wrote:
> On Fri, 21 Jul 2006, Michael Glaser wrote:
> 
 >> Problem: Need to redirect 'www.domain.name/xy' to 'xy.other.domain.net'.
 >>
>> Armed with my very limited knowledge of regular expressions and 
>> mod_rewrite, I tried the following two configurations (one at a time) 
>> and neither worked:
>>
>>  RewriteCond %{REQUEST_URI}   ^/[xX][yY]/(.*) [NC]
>>  RewriteRule ^/[xX][yY]/(.*)  http:/xy.other.domain.net/$1 [R=301,L]

> You're sure that first one didn't work?

Upon further testing, yes and no. With the expression listed above, here 
  is what happens:

www.domain.name/xy  -->  xy.other.domain.net/
www.domain.name/XY  -->  error
www.domain.name/XY/ -->  xy.other.domain.net/
www.domain.name/xY  -->  error
www.domain.name/xy/ -->  xy.other.domain.net/
www.domain.name/Xy  -->  error
www.domain.name/Xy/ -->  xy.other.domain.net/

www.domain.name/xy/about  -->  xy.other.domain.net/about (works!)

The first URL (all lowercase) works without a trailing slash, but not 
the others. I wonder why this is happeing.

Next I tried the following:
   RewriteCond %{REQUEST_URI}  ^/[xX][yY](.*) [NC]
   RewriteRule ^/[xX][yY](.*)  http:/xy.other.domain.net/$1 [R=301,L]

Now this gets me even closer to exactly what I wanted. I removed the 
last '/' in the expression. Now when the URL ends in 'xy' in any 
combination of case, the desired page appears 'xy.other.domain.net/'.

If I include a trailing slash in the original request, the URL in the 
redirected page include an extra one at the end of the address, but the 
page does open. It would look like this:

www.domain.name/xy/  -->  xy.other.domain.net//

Much closer, and this is probably good enough, but not exactly correct. 
Is there an easy way to solve this?

Thanks for the previous reply.
Mike