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 10, 2006
First thing that sticks out is that the your are combining the host and uri in your "contains" comparison. Also, a redirect sends control back to the browser with a redirect code specifing the new url. Your pool statements after the redirect are not valid because control is never not passed to the backend server due to the redirect. Then the browser will come in with the new uri and it won't match your comparison.
when HTTP_REQUEST {
if { "[HTTP::host][HTTP::uri]" starts_with "www.sitename.com/blog" } {
HTTP::redirect "http://blog.sitename.com"
}
}
So all requests that start with "http://www.sitename.com/blog" will be sent back a response to the browser to make a new connection to "http://blog.sitename.com".
If you want to do multiple pools because both hostnames are on the same virutal, then you can use the pool statement to override the default pool but make sure you are comparing the correct strings.
-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
