Forum Discussion
DaveC_21078
Altostratus
Aug 23, 2010Remove www before passing request to web server
Because of a licensing issue, we have to strip www. from the URL before passing it to the web server, if the user typed in www. So a request to www.mypage.com/blah/blah2... should get re-written mypag...
Moe_Jartin
Cirrus
Aug 24, 2010Dave,
You have to add an if statement to determine when you want to redirect. Otherwise, as it is written, you are redirecting EVERY request so the browser gets stuck in an infinite redirect. Install a header plugin in your browser (like LiveHTTPHeaders for Firefox) and watch the headers and you'll see what I mean. Try this.
when HTTP_REQUEST {
if { [HTTP::host] equals "www.mypage.com" }{
HTTP::redirect http://mypage.com[HTTP::uri]
}
}
<\code>
Joe MartinRecent 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
