Forum Discussion
Chenco_322726
Nimbostratus
Nov 08, 2017Url redirect to a subdomain from sepcific URi to subdomain with the same URi
Hello,
We need to achieve this :
(or whatever url after the “mobile”) redirect/rewrite it to : mobile.newdomain.com/news.asp (or whatever url that was entered after the “mobile” in the f...
Nov 08, 2017
Try this rule instead (untested for syntax errors)?
when HTTP_REQUEST {
if { [HTTP::host] eq "mobile.domain.com" } {
HTTP::respond 301 Location "https://mobile.newdomain.com[HTTP::uri]"
} elseif { [string tolower [HTTP::uri]] contains "/mobile" } {
HTTP::respond 301 Location "https://mobile.newdomain.com[string map -nocase { "/mobile" "" } [HTTP::uri] ]";
}
}
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