Forum Discussion
ringoseagull_77
Nimbostratus
Mar 25, 2011irule to remove www. prefix from URIs
Hi,
I'm sure this has been covered but a search brings up a lot of threads using the same words
I need an irule which just strips out the www. from an http request, eg redirect www...
hoolio
Cirrostratus
Mar 25, 2011Sure:
when HTTP_REQUEST {
Check if the host does not start with www.
if {not ([string tolower [HTTP::host]] starts_with "www.")}{
Redirect with the www. prefix to the same URI
HTTP::redirect "http://www.[HTTP::host][HTTP::uri]"
}
}
Aaron
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