Forum Discussion
irule issue - URI Case
Thanks Darrell for your response. I have tried this but webpage is not loading at all. Please let me share with you complete irule for your information. Currently this irule is providing all the required results as it is written. only issue is in https case when someone types in browser with some capital letters those are not redirected to lowercase. SSL offloading is happening on F5.
when HTTP_REQUEST {
tell server not to compress response HTTP::header remove Accept-Encoding disable STREAM for request flowSTREAM::disable
redirect insidecontent requests to insidecontent siteHTTP::uri "[string tolower [HTTP::path]]?[HTTP::query]"
if { [string tolower [HTTP::path]] equals "/" } { if { [HTTP::header "Accept-Language"] starts_with "fr" } { HTTP::respond 301 "Location" "https://www.mylocalnet.com/fr/pages/default.aspx"
} elseif { [HTTP::header "Accept-Language"] starts_with "en" } { HTTP::respond 301 "Location" "https://www.mylocalnet.com/en/pages/default.aspx" }
} elseif { [string tolower [HTTP::path]] equals "/insidecontent/insidecontent.xml" } { HTTP::respond 301 "Location" "https://insidecontent.mylocalnet.com/insidecontent/insidecontent.xml"
} elseif { [HTTP::path] contains "/hr-dept/" } { HTTP::respond 301 noserver Location "https://[HTTP::host][string map -nocase {hr-dept hr-dapart} [HTTP::path]]"
} elseif { [HTTP::path] contains "/fin-inst/" } { HTTP::respond 301 noserver Location "https://[HTTP::host][string map -nocase {fin-inst fin-institute} [HTTP::path]]"
} elseif { [string tolower [HTTP::uri]] equals "/en/private.xml" } { HTTP::uri "/en-private.xml"
} elseif { [string tolower [HTTP::path]] equals "/fr/private.xml" } { HTTP::uri "/fr-private.xml"
} }
when HTTP_RESPONSE {
catch and replace redirect headersif { [HTTP::header exists Location] } { HTTP::header replace Location [string map {"http://" "https://"} [string tolower [HTTP::header Location]]] }
only look at text dataif { [HTTP::header Content-Type] contains "text" } {
create a STREAM expression to replace any http:// with https:// for content delivery networkSTREAM::expression { @ @ @ @ @ @preprod.mylocal.net@ @ }
enable STREAMSTREAM::enable
} }
- JeffRay_129268May 04, 2016
Nimbostratus
Hi all, Any idea about this irule . Am i missing something in the code ? Regards.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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