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 DiscussionsURLProblems connecting to vpn after upgrading to ubuntu 24.04Wildcard SSL Certificate Deployment on F5 LTMiRule resulting in too many redirectsWhat happens if I only enable ASM in BIG-IP Under System > Resource Provisioning
Related ContentCommunity Learning Path: Multi-Cloud NetworkingRedirect the domain name on URL, but keep path as the original URI pathRedirect all request except few pathMultiple Kubernetes Clusters and Path-Based Routing with F5 Distributed CloudTMOS Version Update Paths