Forum Discussion
Casey_Parman_24
Nimbostratus
Jan 11, 2016iRule https redirection
Hello all, I'm new to the f5 world and I'm looking to create an irule for an HTTPS redirection. The main problem that I'm having is that three different FQDN's are used for the same site and redirec...
Arie
Altostratus
Jan 11, 2016I'm afraid I overlooked the requirement for the handling of the home page. Here's the updated rule:
Permanently redirect HTTP to HTTPS
Redirect requests for the home page to /foo/ (retaining query string if present)
when HTTP_REQUEST {
if { [HTTP::path] eq "/" || [string tolower [HTTP::path]] eq "/index.php" } {
HTTP::respond 301 Location "https://[HTTP::host]/foo[HTTP::uri]"
} else
HTTP::respond 301 Location "https://[HTTP::host][HTTP::uri]"
}
}
You'll want to make sure
index.php is replaced with the proper default page name for the home page.
However, is there a good reason to redirect the home page? Wouldn't it be better to keep the URL for the root the same while serving
/foo/?
By the way, crodriguez's solution is also worth considering, although I'm personally a bit hesitant about the increased complexity that's introduced with you deploy an LTP (mainly because it tends to become harder to troubleshoot).
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