Forum Discussion
aguley_212957
Nimbostratus
Nov 17, 2015iRule Redirect
I am very new to iRules. I have the first portion of my rule working correctly
when HTTP_REQUEST {
if {[HTTP::path] eq "/"}{
HTTP::redirect "/ABC/"
}
}
I also want to add to t...
- Nov 17, 2015
Give this a try. Essentially if the path doesn't start with /abc redirect it permanently to https://mysite.com/abc/.
when HTTP_REQUEST { if { not ([string tolower [HTTP::path]] starts_with "/abc") }{ HTTP::respond 301 noserver Location "https://mysite.com/abc/" } }
Brad_Parker
Cirrus
Nov 17, 2015Give this a try. Essentially if the path doesn't start with /abc redirect it permanently to https://mysite.com/abc/.
when HTTP_REQUEST {
if { not ([string tolower [HTTP::path]] starts_with "/abc") }{
HTTP::respond 301 noserver Location "https://mysite.com/abc/"
}
}
aguley_212957
Nimbostratus
Nov 18, 2015Thanks for the response. When I put that in as the irule i get the following from my browser:
The page isn't redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
This problem can sometimes be caused by disabling or refusing to accept cookies.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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