Forum Discussion
Bob_10976
May 12, 2008Nimbostratus
iRule re-write to replace ISAPI re-write
Hello all...
We are currently using ISAPI re-write in our portal to re-write uri's to the appropriate location. With the help of this forum I came up with the following, which work...
Xin_99652
Oct 18, 2008Nimbostratus
Hi Joe/Aaron,
I tired Joe's code and it doesn't work this time. btw, I have used Joe's other code before and it works fine.
What we need it is, there is a web site has two URLs, one with www, and one without www. such as www.mycompany.com and mycompany.com or www.xin.com and xin.com. The web site is working with both URLs. We have asked for any user doesn't matter he use which URL, it should always return the URL with www included the bookmarks he made without www. There are more than one way to do it, I am trying to use the iRules. Can I modify HTTP::host? if we can modify it, all we need is to check the HTTP::host and adding the www if it has no www. Or we can not do this way, we have to redirect the request back to the user with www.
From Joe's code, redirect to "http://www.mycompany.com[HTTP::uri]", can this request sent to any pool in LTM?
do you mean this?
when HTTP_REQUEST {
switch [string tolower [HTTP::host]] {
"www.mycompany.com" {
pool pl_www_mycompany_com
}
"mycompany.com" {
HTTP::redirect "http://www.mycompany.com[HTTP::uri]"
pool pl_www_mycompany_com
}
default {
reject
}
}
}
thanks,
Xin
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