Forum Discussion
Dave_Horsey_225
Nimbostratus
Mar 10, 2006Rewrite URL and change pool trouble
I have been working on a irule to rewrite the URL to do the following:
User sends http://www.sitename.com/blog
bigip changes the url to http://blog.sitename.com/ and redirects the ...
Mar 15, 2006
contains is case sensitive. You'll need to use the "string tolower" command to make your string lower case and then compare against lower case strings
Give this a shot:
when HTTP_REQUEST {
set uri [string tolower [HTTP::uri]]
if { ($uri starts_with "/blog") and
!($uri starts_with "/blogs/menopauseinsight") } {
HTTP::uri "/blogs/menopauseinsight[string range [HTTP::uri] 5 end]"
}
if { $uri contains "blog" } {
HTTP::header replace "Host" "cs.geosign.com"
}
if { $uri contains "utility" } {
HTTP::header replace "Host" "cs.geosign.com"
}
if { $uri contains "blog" } {
pool MIS-WEB21-CS
} else {
pool MIS-WEB20-4
}
}-Joe
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
