Forum Discussion
JeffRay_129268
Nimbostratus
May 26, 2015irule issue
Hi Forum,
I am having one issue of syntax, i have already an irule available for 2 requirements (1 and 2 below) which is working fine. Issue is i need to incorporate solution for the 3rd requirement ...
cjunior
Nacreous
Jun 10, 2015Hi,
If you don't want to expose the new uri path, I guess that you could place it after the redirect conditions:when HTTP_REQUEST {
HTTP::header remove Accept-Encoding
STREAM::disable
redirect autodiscover requests to autodiscover site https
if { [string tolower [HTTP::path]] equals "/autodiscover/autodiscover.xml" } {
HTTP::respond 301 Location https://autodiscover.mynetwork.us/autodiscover/autodiscover.xml
return
redirect mynetwork.us to https://www.mynetwork.us along with any uri
} elseif { [string tolower [HTTP::host]] equals "mynetwork.us" } {
HTTP::respond 302 Location https://www.mynetwork.us[string trimright [HTTP::uri] "/"]
return
redirect if uri is not / but ends with it
} elseif { !([HTTP::uri] equals "/") and [HTTP::uri] ends_with "/" } {
HTTP::respond 302 Location http://[HTTP::host][string trimright [HTTP::uri] "/"]
return
}
switch -glob [string tolower [HTTP::uri]] {
"/gr/mypage.xml*" {
set find "/gr/mypage.xml"
set replace "/gr-mypage.xml"
}
"/fr/mypage.xml*" {
set find "/fr/mypage.xml"
set replace "/fr-sitemap.xml"
}
default {
set find ""
set replace ""
}
}
if { $replace ne "" } {
set rewrite 1
HTTP::uri [string map -nocase "$find $replace" [HTTP::uri]]
unset find replace
}
}
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