Forum Discussion
Bob_10976
Nimbostratus
Jan 23, 2012Limiting WWW redirect to just WWW
Hello all...
We have an irule in place that redirects www.domain.com to non domain.com version. This seems to work fine with one exception. If the end user goes to www.domain.com/blog then the...
Colin_Walker_12
Jan 23, 2012Historic F5 Account
It sounds like you're looking for is for the redirect to include the URI, which is something we've seen many times using the redirect command, and would change very little in your case using the respond command:
when HTTP_REQUEST {
if { [HTTP::host] eq "www.domain.com"} {
HTTP::respond 301 Location "http://domain.com[HTTP::uri]"
}
}
In this fashion whatever URI the user requested along with the hostname would remain intact after the redirect.
Colin
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
