Forum Discussion
winifred_corbet
Nimbostratus
Jan 24, 2011Replace HOST not working
We have a list of URIs that we added to a data group
For only those URIs in the datagroup, we need to change the Hostname, keeping the URI
This irule attempt is not working. Host name is not changing. What are we missing?
when HTTP_REQUEST {
if { [matchclass [string tolower [HTTP::uri]] starts_with $::abunchofURLs] } {
HTTP::header replace Host "www.brand-new-name.com"
}
}
4 Replies
Sort By
- winifred_corbet
Nimbostratus
- Chris_Miller
Altostratus
So, if your rule looks like the below, you're actually seeing the log show up?when HTTP_REQUEST { if { [matchclass [string tolower [HTTP::uri]] starts_with $::abunchofURLs] } { HTTP::header replace Host "www.brand-new-name.com" log local0. "URI was [HTTP::uri] and host was changed from [HTTP::host] to "www.brand-new-name.com" } }
- Colin_Walker_12Historic F5 AccountTo be clear, you're just looking to replace the host header, not actually redirect the user so that the browser's URL bar updates, right? If you re-write the host header on the LTM the request should arrive at the correct location but the user will not see the change to the host.
- hoolio
Cirrostratus
A few related possibilities:
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