Re: Redirection with 301 for all subdomains with exception

From: Falco SCHMUTZ <fschmutz#lovaservices.net>
Date: Mon, 6 Jul 2009 14:05:09 +0200


Hello,
I m sorry to disturb you again, but some problem persist.

This is my final configuration and it works fine :

acl es path_beg /es
redirect location http://www.newdomain.com/es/marruecos.html code 301 if es acl en path_beg /en
redirect location http://www.newdomain.com/en/morocco.html code 301 if en acl www hdr(host) -i www.
redirect location http://www.newdomain.com/maroc.html code 301 if www acl admin hdr_beg(host) -i admin
redirect location https://admin.newdomain.com code 301 if admin acl pro hdr_beg(host) -i pro
redirect location http://pro.newdomain.com code 301 if pro acl olddom hdr_end(host) -i olddomain.com redirect prefix http://www.newdomain.com code 301 if olddom

But url with some page html do not rewrite correctly with extension path /es/ or /en/ :
Ex :
http://www.olddomain.com/es/promotions.html -> http://www.newdomain.com/es/marruecos.html but we need
http://www.olddomain.com/es/promotions.html -> http://www.newdomain.com/es/promotions.html

For information we really need this and currently work fine : http://www.olddomain.com/es/ -> http://www.newdomain.com/es/marruecos.html

Thanks in advance
Falco

2009/7/3 Falco SCHMUTZ <fschmutz#lovaservices.net>

> Thanks,
> All acl works, i m really sorry for the trouble :x
> Good week end.
> Falco
>
>
> 2009/7/3 Willy Tarreau <w#1wt.eu>
>
>> On Fri, Jul 03, 2009 at 03:22:44PM +0200, Falco SCHMUTZ wrote:
>> > Sorry,
>> > Ok, i do it short, i need just 3 fix redirect in 301:
>> > http://www.olddomain.com/es/ ->
>> http://www.newdomain.com/es/marruecos.html
>> > http://www.olddomain.com/en/ ->
>> http://www.newdomain.com/en/morocco.html
>> > http://www.olddomain.com/ -> http://www.newdomain.com/maroc.html
>> >
>> > This is use for inform my user because the site change, and there is
>> > redirect to a special page by country.
>> >
>> > But some request from google use old page and i need to move it in 301.
>> > So i just need to all others requests possibles are redirect too.
>> > www.olddomain.com/* -> www.newdomain.com/*
>> >
>> > Maybe it s quite simple like this ?
>>
>> yes :-)
>>
>> Then I can confirm that your proposal below is OK. First you put the 3
>> "redirect location" rules, then the final "redirect prefix" rule to
>> switch to the new domain.
>>
>> > Sorry to confuse you :-(
>> > Thanks
>> > Falco
>>
>> Regards,
>> Willy
>>
>> > 2009/7/3 Willy Tarreau <w#1wt.eu>
>> >
>> > > On Fri, Jul 03, 2009 at 03:04:56PM +0200, Falco SCHMUTZ wrote:
>> > > > Thanks at all,
>> > > > Are you sure i can use :
>> > > >
>> > > > this first configuration :
>> > > > acl es path_beg /es
>> > > > redirect location http://www.newdomain.com/es/marruecos.html if es
>> > > > acl en path_beg /en
>> > > > redirect location http://www.newdomain.com/en/morocco.html if en
>> > > > acl www hdr(host) -i www.
>> > > > redirect location http://www.newdomain.com/maroc.html if www
>> > > >
>> > > > then :
>> > > > acl olddom hdr_end(host) -i olddomain.com
>> > > > redirect prefix http://www.newdomain.com if olddom
>> > > >
>> > > > because i really need to redirect
>> > > > http://www.olddomain.com/es/<
>> > > http://www.newdomain.com/olddirectory/oldhtmlpage.*>
>> > > > -> http://www.newdomain.com/es/marruecos.html
>> > > > http://www.olddomain.com/en/<
>> > > http://www.newdomain.com/es/olddirectory/oldhtmlpage.*>
>> > > > -> http://www.newdomain.com/en/morocco.html
>> > > > http://www.olddomain.com/<
>> > > http://www.newdomain.com/en/olddirectory/oldhtmlpage.*>
>> > > > -> http://www.newdomain.com/maroc.html
>> > > >
>> > > > then old directory and old html page to
>> > > >
>> > > > http://www.olddomain.com/directory/htmlpage.* ->
>> > > > http://www.newdomain.com/directory/htmlpage.*
>> > > > http://www.olddomain.com/es/directory/htmlpage.* ->
>> > > > http://www.newdomain.com/es/olddirectory/htmlpage.*
>> > > > http://www.olddomain.com/en/directory/htmlpage.* ->
>> > > > http://www.newdomain.com/en/olddirectory/htmlpage.*<
>> > > http://www.newdomain.com/olddirectory/oldhtmlpage.*>
>> > >
>> > > I'm sorry, but you confused me a lot, and now I'm not sure I
>> > > understand what you need / want :-/
>> > >
>> > > > Last question, the option 301 does it work with those redirects ?
>> > >
>> > > Yes, just add "code 301" to the line.
>> > >
>> > > Regards,
>> > > Willy
>> > >
>> > >
>>
>
>
Received on 2009/07/06 14:05

This archive was generated by hypermail 2.2.0 : 2009/07/06 14:15 CEST