Forum Discussion
Colin_Walker_12
Jul 01, 2011Historic F5 Account
It looks like you're making this a lot more complicated than it needs to be, unless I'm missing something. If all you want to do is ensure there is always a www on the host, all you'd need is:
when HTTP_REQUEST {
if{[HTTP::host] eq "mywebsite.com"] {
HTTP::redirect "http://www.mywebsite.com[HTTP::uri]"
}
}
That should take care of it for you regardless of the URI.
If there is something more complicated that you're trying to do, I missed it. Let me know what it is and I'll take a look.
Colin