Forum Discussion
dionlbc_22838
Jan 18, 2012Nimbostratus
Host and URI rewrite
Hi All,
I'm stepping in to help with an F5 configuration while our person who is primarily responsible is out on maternity leave. I'm looking to do what seems to be a simple redirect of the hostname and URI.
I'm trying to redirect the following -
http://corporate.company.com/products/pwa
redirects to
http://project.company.com/products/pwa
I would like to keep any paths beyond /pwa in the URL when the redirection is made if possible.
Thanks for any and all help! :)
- hooleylistCirrostratusHi,
when HTTP_REQUEST { if {[string tolower [HTTP::host]] eq "corporate.company.com"\ and [string tolower [HTTP::uri]] starts_with "/products/pwa"}{ HTTP::redirect "http://project.company.com[HTTP::uri]" } }
- dionlbc_22838NimbostratusThank you Hoolio! This worked perfectly!
- Ruddiger_79923NimbostratusHi there! I'm new to iRules and was wondering how I could do a similar thing but have it redirect all requests but keep the trailing path. ie:
- Michael_YatesNimbostratusHi Ruddiger,
when HTTP_REQUEST { if {[string tolower [HTTP::host]] eq "corporate.company.com" } { HTTP::redirect "http://development.company.com[HTTP::uri]" } }
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