Forum Discussion
How to replace [HTTP::host] using regex
- Jun 23, 2021
My solution without "regex":
HTTP::header replace Host [string map -nocase {".domain.com" ".newdomain.com"} [HTTP::host]]The level 3 (or 4) subdomain is untouched. This solves my problem.
I'd like to know solution with regex, because sometimes is helpful string manipulation like this: foo.domain.com -> foo.com (in this case is 'foo' is unknown, therefore is regex helpful).
My solution without "regex":
HTTP::header replace Host [string map -nocase {".domain.com" ".newdomain.com"} [HTTP::host]]The level 3 (or 4) subdomain is untouched. This solves my problem.
I'd like to know solution with regex, because sometimes is helpful string manipulation like this: foo.domain.com -> foo.com (in this case is 'foo' is unknown, therefore is regex helpful).
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
