Forum Discussion
Puneet_73909
Nimbostratus
May 11, 2009Redirection iRule
Hi,
I need help in writing an iRule. I want to read domain name and then redirect it to specific URL.
For example if HHTP::request is for www.domain.com then it will redirect it to www....
Puneet_73909
Nimbostratus
May 11, 2009Thnx CB..
What I mean to say is the way I am matching "www" and redirecting it to some url and "www1" to some url. I want the redirection if I get www.joinxyz.com (join keyword in domain name) to www.joinxyz.com/doc/index.html and same goes for www1.joinxyz.com to www1.joinxyz.com/doc/index.html.
Given below is the iRULE which wrote but I have to add the JOIN keyword rule in this...
when HTTP_REQUEST {
Check if requested host start with www.example.com
if {[string tolower [HTTP::host]] equals "www.example.com"} {
HTTP::redirect "http://www.DomainName.com/nmhomepage.jsp"}
elseif {[string tolower [HTTP::host]] starts_with "www1."} {
Replace the host header value with www1.example.com
HTTP::redirect "http://www1.DomainName.com/nmhomepage.jsp"}
elseif {([HTTP::uri] starts_with "doc" or "minisite" or "fslink" or "ms" or "link" or "null-request" or "exttracking.dyn")} {
Redirection
HTTP::redirect "http://[HTTP::host]/nmhomepage.jsp"}
}
Will this work????
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
