Forum Discussion
Kai_Wilke
Jan 02, 2016MVP
Hi Dennis,
the code looks good. But i duno if you want to have relative redirects based on your website root. If you want a fixed https://* redirect, then take a look to the last line below...
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/oas/ops/programs*" { HTTP::redirect "https://www.mycompany.com[HTTP::uri]" }
Redirects http://* to http://* and https:// to https://*
"/offices/management/ocio/eng/tacticalcommunications*" { HTTP::redirect [string map {"/offices/management/ocio/eng/tacticalcommunications/" "/sites/taccom/"}[HTTP::uri]]}
Redirects http://* and https://* to https://* with -nocase option
"/offices/management/ocio/eng/tacticalcommunications*" { HTTP::redirect "https://www.mycompany.com[string map -nocase {"/offices/management/ocio/eng/tacticalcommunications/" "/sites/taccom/"} [HTTP::uri]]"}
}
}
P.s.: In addition it contains a [string map -nocase] syntax to support case-insensitive deep-links. I guess it would be much more user friendly, isn't it? 😉
Cheers, Kai