Forum Discussion
plavender_72604
Nimbostratus
May 12, 2010URL rewrites for multiple domains
Hopefully someone can help me out here, scripting is not my strong point and each time I try to search this forum I get an error :-(
I would like to set up the F5 so that multiple sub domains get the URL rewritten and then directed to a specific pool.
For example:
http://aaa.domain.com gets a url rewrite to http://domain.com/aaa and the traffic gets sent to pool aaa
http://bbb.domain.com gets a url rewrite to http://domain.com/bbb and the traffic gets sent to pool bbb
Any help will be greatly appreciated!
Thanks in advance!
- plavender_72604
Nimbostratus
Hey All,Check host/uri (set to lowercase) switch "[string tolower [HTTP::host]]" { "aaa.domain.com" { Rewrite host/URI HTTP::header replace Host "domain.com" HTTP::uri "/aaa" pool aaa_pool } "bbb.domain.com" { Rewrite host/URI HTTP::header replace Host "domain.com" HTTP::uri "/bbb" pool bbb_pool } } } Thanks again! Peter
- hoolio
Cirrostratus
Hi Peter,if {not ([HTTP::path] starts_with "/aaa")}{ HTTP::path "/aaa[HTTP::path]" }
if {[HTTP::path] eq "/"}{ HTTP::path "/aaa[HTTP::path]" }
- plavender_72604
Nimbostratus
Hi Aaron,when HTTP_REQUEST { if { [active_members http_pool] >= 2 } { pool primary_pool } else { pool alternate_pool
when HTTP_REQUEST { Check host/uri (set to lowercase) switch "[string tolower [HTTP::host]]" { "aaa.domain.com" { Rewrite host/URI HTTP::header replace Host "domain.com" HTTP::uri "/aaa" if { [active_members http_pool] >= 2 } { pool aaa_pool } else { pool aaa_alternate_pool } Thanks again! Peter
- hoolio
Cirrostratus
- plavender_72604
Nimbostratus
Thanks again! I'll carry on playing!
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