Re: Redirection with 301 for all subdomains with exception

From: Falco SCHMUTZ <fschmutz#lovaservices.net>
Date: Fri, 3 Jul 2009 15:04:56 +0200


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

Last question, the option 301 does it work with those redirects ?

Many thanks in advance.
Falco

2009/7/3 Willy Tarreau <w#1wt.eu>

> On Fri, Jul 03, 2009 at 12:25:46PM +0200, Falco SCHMUTZ wrote:
> > Hello,
> > I have one question more about redirection :
> > We want to redirect one old domain to the new one with some conditions.
> >
> > We configure some acl like this and it's work fine :
> >
> > 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
> >
> >
> > But we need one action when some users used old link maybe like this :
> >
> > http://www.olddomain.com/olddirectory/oldhtmlpage.*
> > http://www.olddomain.com/es/olddirectory/oldhtmlpage.*
> > http://www.olddomain.com/en/olddirectory/oldhtmlpage.*
> >
> > do you know if with the first acl configuration, we can redirect user to
> :
> >
> > http://www.newdomain.com/olddirectory/oldhtmlpage.*
> > http://www.newdomain.com/es/olddirectory/oldhtmlpage.*
> > http://www.newdomain.com/en/olddirectory/oldhtmlpage.*
>
> yes, you can do that using "redirect prefix" that way :
>
> acl olddom hdr_end(host) -i olddomain.com
> redirect prefix http://www.newdomain.com if olddom
>
> The redirect rule will then cause a "Location: http://www.newdomain.com/
> <olduri>"
> header to be emitted. It's typically useful to change domains or
> to switch between http and https.
>
> Regards,
> Willy
>
>
Received on 2009/07/03 15:04

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