Forum Discussion
Joe_Pipitone
Nimbostratus
May 12, 2010Redirects / rewrites conflicting
I have a master iRule which seems to be throwing a "Multiple redirect/respond invocations now allowed"
The iRule is as follows. It tries to match certain urls typed in by the user, and redirects. A...
Jose_Santiago_O
Nimbostratus
May 12, 2010Can 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
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects