Forum Discussion
Chris_Robert_10
Nimbostratus
Sep 15, 2006URL rewrite plus
I currently have this iRule running:
when HTTP_REQUEST {
if { [HTTP::uri] equals "/www.mysite.com/" } {
HTTP::uri "/www.mysite.com/index.htm/"
}
}
...
Deb_Allen_18
Sep 15, 2006Historic F5 Account
URL's take the form of:
scheme://host/uri
For this URL: http://www.mysite.com/index.htm
[HTTP::host] will return "www.mysite.com"
and
[HTTP::uri] will return "/index.htm"
If you just want to change the Host header to www.mysite.com and explicitly include the page name in the URI, you can use this code:
when HTTP_REQUEST {
if {[string tolower [HTTP::host] equals "mysite.com" } {
HTTP::header replace Host "www.mysite.com"
HTTP::uri "/index.htm"
}
}
HTH
/deb
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