Forum Discussion
Carl_Zemke_1882
Nimbostratus
Jun 06, 2007UIR rewrite based on Hostname
Sorry for being so ignorant with IRules but for the life of me, I can't seem to get anything working correctly here.
I need a Rule that will rewrite the URI portion of a HTTP request based on the Hostname.
If HTTP:host eq Awww.something.com
rewrite Awww.something.com/directory1
elseif HTTP:host eq Bwww.something.com
rewrite Bwww.something.com/directory2
else discard
Thanks in Advance,
Carl
1 Reply
- JRahm
Admin
Try this:when HTTP_REQUEST { if { ([string tolower [HTTP::host]] equals "awww.something.com") } { HTTP::uri "/directory1[HTTP::uri]" } elseif { ([string tolower [HTTP::host]] equals "bwww.something.com") } { HTTP::uri "/directory2[HTTP::uri]" } else { discard } }
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