Forum Discussion
OttimoMassimo_1
Nov 08, 2010Nimbostratus
HTTP re-write
Hi,
Apologies in advance for the newbie question!
I'd like to apply a HTTP re-write so when a user browses to blog.site.com they are redirected to www.site.com/blog/, but blog.site.com remains in the user's address bar.
I can currently redirect from blog.site to www.site.com/blog/ with the configuration below. Unfortunately www.site.com/blog appears in the address bar of the browser after the redirect. Is it possible to "re-write" to a new URL in the manner I've outlined?
when HTTP_REQUEST
....
switch [HTTP::host] {
"blog.site.com" {
HTTP:redirect "http://www.site.com/blog/"
}
- The_BhattmanNimbostratusHi OttimoMassimo,
HTTP_REQUEST { switch -glob [HTTP::host] { "blog.site.com" { HTTP::header replace Host "www.site.com" HTTP::uri /blog [HTTP::uri] } } }
HTTP_REQUEST { switch -glob [HTTP::host] { "blog.site.com" { HTTP::redirect http://www.site.com/blog/ } } }
- OttimoMassimo_1Nimbostratusthanks Bhattman. I'll give that a try and let you know how I get on
- hooleylistCirrostratusYou could also use the ProxyPass iRule for this:
- OttimoMassimo_1Nimbostratusso yeah, got this working in the end with the following:
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