Forum Discussion
Devonion_22138
May 14, 2012Nimbostratus
Redirect to test server and rewrite returned links
I'm trying to write an irule so that I can use a cloned live webserver to test a PHP upgrade.
irule basically changes host header from www.dev.ourserver.com to www.ourserver.com and this part works ...
Devonion_22138
May 15, 2012Nimbostratus
OK, so I went back to the drawing board, read some more and realised I was completely over complicating things here.
I kept my http_request section to rewrite the header, works as expected.
I then did as you suggested and used the default STREAM profile and this now works a treat.
So!! Last piece of the puzzle is a valid replace command in the target of my stream profile.
I've left the source empty and in the target I've added @www.ourserver.com@www.dev.ourserver.com@
Now this is great for testing, but we have loads of Virtual Hosts, some with different domains and so I need a regex
I tried the following but could not save the profile due to an error about it being bad
It works in sed, but I know only basic regex is supported in the stream profile, but I thought this was pretty basic.
This is a simplified version but syntax is same as my target.
@www\(.*\).com@www.dev\1.com@
Is this sort of substitution possible in the stream profile? I get "bad regular expression in stream" error when I try to save this.
Thanks
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