Silver_backAltostratusFeb 08, 2022URL redirect with path I am trying to create a redirect irule but is not a standard redirect. It basically needs to take the URL + path and redirect it to another website + the path of the old URL. E.g. www.abc.com/path1/...Show More
JRahmAdminFeb 08, 2022A couple comments/questions... All URLs start with "/", so as long as the host is www.abc.com, you'll never get to the else. There is no need to string tolower the host, that is case insensitive according to the RFC. Do you want any redirects if the host is not www.abc.com? If it's not, there is no additional logic to handle that. That said, assuming you don't need any redirects for the non-matching host, here's how I'd write that: when HTTP_REQUEST { if { ([HTTP::host] eq "www.abc.com") and not([HTTP::uri] eq "/") } { HTTP::respond 301 Location "http://jrahmtest.local[HTTP::uri]" event disable all } elseif { [HTTP::host] eq "www.abc.com" } { HTTP::respond 301 Location "http://jrahmtest.local/" event disable all } } Test results:
Recent Discussionsapm session variable from part of uri...F5Access | MacOS SonomaCVE-2024-21410Exchange server extended protection and BigIPSSLO Limited with AWAF License
Related ContentCommunity Learning Path: Multi-Cloud NetworkingRedirect all request except few pathRedirect the domain name on URL, but keep path as the original URI pathMultiple Kubernetes Clusters and Path-Based Routing with F5 Distributed CloudTMOS Version Update Paths