Forum Discussion
URL rewrite
Hi kevinmc,
first you need to be clear about the wording rewrite and redirect.
Redirect: Sending the client a 301/302 response with the new correct URL. The client will then send a new request towards the new URL.
Rewrite: F5 takes the URL from the client, changes the URL (hostname and/or URI) and forward the request with this new URL towards the real server. Means the client still sees the "old" URL in its browser bar, but the real server sees the new URL.
So you are talking about a redirect and this can be handled with the following iRule:
when HTTP_REQUEST {
if {[string tolower [HTTP::Host]] starts_with "sharepoint.abc.net"} {
For a 301 redirect us this line
HTTP::respond 301 location "http(s)://home.sharepoint.hscni.net[HTTP::uri]"
For a 302 redirect us this line
HTTP::redirect "http(s)://home.sharepoint.hscni.net[HTTP::uri]"
}
}
Hope that's clear now.
Ciao Stefan 🙂
Recent Discussions
Related Content
* 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