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 14, 2006
In your HTTP::uri command, you are referencing a variable named "uri". This will be undefined unless you specifically set it with the "set" command. Also, the error for "then" is because there is no "then" reserved word. The "then" is the contents of the enclosed braces.
Also, are you sure the "string range" command is returning what you want. It's returning from the 27th character to the end of the string, or an empty string if the URI isn't 27 characters.
Give this a try.
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/blog" } {
HTTP::uri "/blogs/menopauseinsightblog[string range [HTTP::uri] 27 end]"
}
if { [HTTP::host] eq "www.xxxxxxxxxinsight.com" } {
HTTP::header replace "Host" "cs.geoxxxx.com"
} elseif { [HTTP::host] eq "xxxxxxxxxinsight.com" } {
HTTP::header replace "Host" "cs.geosign.com"
}
if { [HTTP::uri] contains "/blog" } {
pool MIS-WEB21-CS
} else {
pool MIS-WEB20-4
}
}-Joe
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
