Forum Discussion
Combine irules to avoid http redirect error
ltm rule /Common/iRule_https_redirect_301 { when HTTP_REQUEST { HTTP::respond 301 Location https://[getfield [HTTP::host] ":" 1][HTTP::uri] } ltm rule /Common/iRule_Sitecore_Login_redirect { when HTTP_REQUEST { if { [string tolower [HTTP::uri]] eq "sitecore/login$"} { HTTP::respond 301 Location "[HTTP::host]" } ltm rule /Common/iRule_Skyscape { when HTTP_REQUEST { if {[string tolower [HTTP::host]] eq "; }{ HTTP::respond 301 Location "https://www.homesbylendlease.co.uk/development/west-grove/?utm_source= skyscape_domain &utm_medium=redirects" } } ltm rule /Common/iRule_Sitecore_dev { when HTTP_REQUEST { if { [string tolower [HTTP::uri]] contains "/_dev"} { HTTP::redirect "http://[HTTP::host]/" } ltm rule /Common/iRule_Redirect_sitecore { when HTTP_REQUEST { if { [string tolower [HTTP::uri]] contains "/sitecore"} { HTTP::redirect "http://[HTTP::host]/"
Need to combine these irules to avoid redirect error message, please help.
- sagar33_370912
Nimbostratus
ltm rule /Common/iRule_https_redirect_301 { when HTTP_REQUEST { HTTP::respond 301 Location https://[getfield [HTTP::host] ":" 1][HTTP::uri] }
ltm rule /Common/iRule_Sitecore_Login_redirect { when HTTP_REQUEST { if { [string tolower [HTTP::uri]] eq "sitecore/login$"} { HTTP::respond 301 Location "[HTTP::host]" }
ltm rule /Common/iRule_Skyscape { when HTTP_REQUEST { if {[string tolower [HTTP::host]] eq "; }{ HTTP::respond 301 Location "https://www.homesbylendlease.co.uk/development/west-grove/?utm_source= skyscape_domain &utm_medium=redirects" } }
ltm rule /Common/iRule_Sitecore_dev { when HTTP_REQUEST { if { [string tolower [HTTP::uri]] contains "/_dev"} { HTTP::redirect "http://[HTTP::host]/" }
ltm rule /Common/iRule_Redirect_sitecore { when HTTP_REQUEST { if { [string tolower [HTTP::uri]] contains "/sitecore"} { HTTP::redirect "http://[HTTP::host]/"
- sagar33_370912
Nimbostratus
PLease combine these rules into one single rule and let me know.
- youssef1
Cumulonimbus
Hi,
you can try this:
when HTTP_REQUEST { if { [string tolower [HTTP::uri]] eq "/sitecore/login$"} { HTTP::respond 301 Location "[HTTP::host]" } if {[string tolower [HTTP::host]] eq "www.skyscapecollection.com"; }{ HTTP::respond 301 Location "https://www.homesbylendlease.co.uk/development/west-grove/?utm_source= skyscape_domain &utm_medium=redirects" } if { [string tolower [HTTP::uri]] contains "/_dev"} { HTTP::redirect "http://[HTTP::host]/" } if { [string tolower [HTTP::uri]] contains "/sitecore"} { HTTP::redirect "http://[HTTP::host]/" } }
Just keep in mind that i don't set the following rules (you risk having loop errors: tcl error):
HTTP::respond 301 Location https://[getfield [HTTP::host] ":" 1][HTTP::uri]
This rules have to be set on http vs in order to do a redirect in https. no in your App VS that already in https
Second point i replace "sitecore/login$" by "/sitecore/login$", you forget a slash.
if you give me more details of app i can optimise you this irule.
regards
Recent Discussions
Related Content
* 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