Forum Discussion
Cory_12946
Jan 28, 2011Historic F5 Account
URL removal
Im sure this is a dumb question but here goes:
I need a irule/method to do the following:
client access a vip of any of the following:
http://www.abc.com https://www.ab...
hooleylist
Jan 28, 2011Cirrostratus
Hi Cory,
Do you want the client to see the change in the address bar? If so, you can send the client a redirect to the correct hostname. One possible issue with this approach is that your cert for the HTTPS virtual server must be valid for abc.com and www.abc.com in order to avoid the browser showing a mismatched hostname warning to the user.
when HTTP_REQUEST {
Check if requested host is not abc.com
if {[string tolower [HTTP::host]] ne "abc.com"}{
Check if the request was mode on port 443
switch [TCP::local_port] {
443 {
set proto https
}
default {
set proto http
}
}
Send the client a 302 redirect with the original URI preserved
HTTP::redirect "${proto}://abc.com[HTTP::uri]"
}
}
Here's a method to rewrite the host header before LTM proxies requests to the pool:
when HTTP_REQUEST {
Check if requested host is not abc.com
if {[string tolower [HTTP::host]] ne "abc.com"}{
Rewrite the host header
HTTP::header replace Host "abc.com"
}
}
Aaron
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