Forum Discussion
Kevin_Nail
Nimbostratus
Feb 08, 2007Simple URL host rewrite
I am trying to do a simple rewrite of the URL host. Currently when users type in the following: "https://mydomain.state.company.com" they are getting a security alert screen complaining that the name doesn't match the certificate. The certificate was generated with the name "mydomain.company.com"
I am trying to rewrite the URL so that host part of incoming requests will get changed to "mydomain.company.com"
However I can't seem to get it working right. The log never shows the rewrite. Am I missing something here? Any help would be appreciated.
Here is my rule
when HTTP_REQUEST {
if {[HTTP::host] contains "state.company.com"} {
HTTP::header replace "Host" "mydomain.company.com"
log local0. "This is the new host: [HTTP::host]"
}
}
The log is showing:
Feb 8 10:41:04 tmm tmm[706]: Rule myrule_rewrite : This is the new host: mydomain.state.company.com
- Kevin_Nail
Nimbostratus
Thanks for the information. - Kevin_Nail
Nimbostratus
Thanks Colin, - Colin_Walker_12Historic F5 AccountActually, you wouldn't even need coding for this. I'd recommend looking into the stream profile if you're looking to re-write the HTTP payload the server is responding with. There is some good documentation of this in the user guides, I believe.
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