Forum Discussion
host rewrite newbi
simple change from https://test.irule.test.com/hello.html to https://preview.test.com/hello.html
also would like to to the following https://test.irule.test.com/***any uri *** https://preview.test.com/***any uri***
Will this do it?
when HTTP_REQUEST {
if { [HTTP::host] contains "test.irule.preview.test.com" } {
set HTTP::host "preview.test.com"
}
}
because I only get page cannot be displayed if I go to test.irule.test.com/test.html, I cannot see preview.test.com/test.html
Thanks
6 Replies
- What_Lies_Bene1
Cirrostratus
If you're happy with a redirect (that will show the other domain name in the browser address bar) this will do it;when HTTP_REQUEST { if { [HTTP::host] contains "test.irule.test.com" } { HTTP::redirect "https://preview.test.com[HTTP::uri]" } } - gusf5_117081
Nimbostratus
Thank you very much!!
If I want to do a invisible HTTP::host change, will it be?
when HTTP_REQUEST {
if { [HTTP::host] contains "test.irule.preview.test.com" } {
set HTTP::host "preview.test.com[HTTP::uri]""
}
} - What_Lies_Bene1
Cirrostratus
You're welcome. It's a bit different if you want it to be invisible to the user and no need to touch the URI (although an absolute URI could bypass the host check);when HTTP_REQUEST { if { [HTTP::host] contains "test.irule.test.com" } { HTTP::header remove Host HTTP::header insert Host "preview.test.com" } } - gusf5_117081
Nimbostratus
Is there a reason why when I enable the irule the site stops working.
I have it working with a default persistence profile dest_addres and I add the http profile for the http and the https traffic and nothing comes up.
Well thanks for you help - gusf5_117081
Nimbostratus
I got it working on http, for some reason in the test environment with self signed certificates the https traffic drops as soon as I add a http profile. Any ideas?
Thanks - What_Lies_Bene1
Cirrostratus
You'll need separate VSs for HTTP and HTTPS traffic I'd imagine. You can't inspect SSL without assigning a ClientSSL profile.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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