Forum Discussion
Craig_17766
Aug 29, 2013Nimbostratus
URL rewriting on our DR F5 for functionality testing
Hi all,
I’d be grateful for some advice or some insight with something I am trying to do – I presume I’ll need to use irules.
We have a backup site with copies of our apps that IIS expect ...
JRahm
Aug 29, 2013Admin
easiest route is using host entries on your test systems. Do you have GTM? If so, you could use an iRule to give your backupsite as an answer for certain source IPs then you don't need to manipulate names at all. If neither of those are an option, you can rewrite them. Something like this should get you started:
when HTTP_REQUEST {
if { [HTTP::host] eq "www.backupsite.co.uk" } {
set is_rewrite 1
HTTP::header replace host "www.mysite.co.uk"
}
}
when HTTP_RESPONSE {
if { [info exists is_rewrite] } {
HTTP::header replace Location [string map "www.mysite.co.uk www.backupsite.co.uk" [HTTP::header Location]]
}
}
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