Forum Discussion
scott_poquette_
Nimbostratus
Aug 02, 2006How to append www to a url
Anyone know how I would rewrite the following rule for v9.x?
else if (http_header("Host") starts_with "mysite") {
redirect to "http://www.mysite.com/%u"
}
Or is there a better way to append www to a url?
Thanks
- hoolio
Cirrostratus
You could either redirect to www.mysite.com, or rewrite the request before it's sent to the pool and not send a rediret back to the client.when HTTP_REQUEST { if { HTTP::host starts_with "mysite" }{ HTTP::redirect http://www.mysite.com/[HTTP::uri] } }
when HTTP_REQUEST { if { HTTP::host starts_with "mysite" }{ HTTP::host www.mysite.com } }
- scott_poquette_
Nimbostratus
Okay seems simple enough.
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