Forum Discussion
Jose_Santiago_O
May 12, 2010Nimbostratus
Can you try this:
when HTTP_REQUEST {
if { ([HTTP::host] eq "www.oursite.com") } {
HTTP::redirect "http://oursite.com[HTTP::uri]"
return
}
switch -glob [string tolower [HTTP::uri]] {
"/survey" -
"/survey/" {
HTTP::redirect "http://oursite.com/surveys/"
return
}
"/surveys" {
HTTP::redirect "http://oursite.com/newsurveys/"
return
}
"/anotherurl/survey2008" -
"/anotherurl/survey2008/" {
HTTP::redirect "http://oursite.com/whitepapers/2009/05/survey.aspx"
return
}
"/anotherurl/survey2007" {
HTTP::redirect "http://oursite.com/whitepapers/2009/05/2007survey.aspx"
return
}
"/images*" {
HTTP::redirect "http://legacy.oursite.com[HTTP::uri]"
return
}
}
}
The script first redirects the user to the site without www if exists, if not, makes the redirects depending on the uri.
Is this what you want? Are virtual servers the same for the domain with and without www?
If you are trying to send to the web servers the requests without the www in the header, you can just replace the host header:
HTTP::header replace Host oursite.com
this way the user will never see a redirect, it would be transparent.
please tell me if that helps you.
regards.
May be you are trying