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...
The_Bhattman
Nov 08, 2010Nimbostratus
Hi OttimoMassimo,
There are 2 ways to ago about this.
Do you want the user who enters blog.site.com to be redirect to www.site.com/blog but still retain the blog.site.com on the user's URL on the browser?
If so then your code would look something like this.
HTTP_REQUEST {
switch -glob [HTTP::host] {
"blog.site.com" {
HTTP::header replace Host "www.site.com"
HTTP::uri /blog [HTTP::uri]
}
}
}
or
Do you want to a user who enters blog.site.com to be redirected to www.site.com/blog, but have www.site.com/blog on the user's URL on the browser?
If so then the code would look something like the following:
HTTP_REQUEST {
switch -glob [HTTP::host] {
"blog.site.com" { HTTP::redirect http://www.site.com/blog/ }
}
}
I hope this helps
Bhattman
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