Forum Discussion
gkorah_32913
Nimbostratus
Sep 16, 2010iRule for HTTP redirect
I am able to get http redirect working for a FQDN (eg - www.xyz.com), which I have it set to go to www.abc.com
The issue I run into is that the redirect to www.abc.com also works when the path has a path following in the FQDN, for eg like www.xyz.com\workspace\default.asp. This also gets redirected to www.abc.com.
How can i setup my iRule to allow http redirect to www.abc.com only if the request is to www.xyz.com, everything else follows the same original URL path.
Please advise & thanks in advance.
--
GK
- Chris_Miller
Altostratus
Which of the following are you trying to do:when HTTP_REQUEST { if { [string tolower [HTTP::host]] eq "www.xyz.com" and [string tolower [HTTP::uri]] eq "/" } { HTTP::redirect "http://www.abc.com" } }
when HTTP_REQUEST { if { [string tolower [HTTP::host]] eq "www.xyz.com" } { HTTP::redirect "http://www.abc.com[HTTP::uri]" } }
- gkorah_32913
Nimbostratus
Chris - Thx for the info. This is what I want to do - - Chris_Miller
Altostratus
Posted By gkorah on 09/16/2010 08:44 AM - gkorah_32913
Nimbostratus
Perfect. That worked. Thanks for the help. - FYI-when referring to the "path" after a FQDN, this is typcally called the "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