Forum Discussion
onlineops
Nimbostratus
May 01, 2018irule: root domain (only) non-www to www redirect
I have a series of websites that need a non-www to www redirect, bu I still need to support direct subdomains without a redirect.
Example:
http://abc.com redirects to http://www.abc.com http://...
OM
Nimbostratus
May 01, 2018Hi, fo a specific domain irule, you can use:
when HTTP_REQUEST { if { ([HTTP::host] eq "abc.com")}{ HTTP::redirect .[HTTP::host][HTTP::uri] } }
For global domain irule, you might need a regex, maybe something like this:
when HTTP_REQUEST { if { ([HTTP::host] eq "^[^.]+$.com") } { HTTP::redirect .[HTTP::host][HTTP::uri] } }
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