Forum Discussion
Joseph_Gallo_31
Nimbostratus
Jan 08, 2009Need Assitstance in Rewriting URL
I need help in creating an iRule that will accomplish the following behavior:
When an end user types "https://www.domain.com/help" they need to be redirected to "https://www.domain.com:223/user/guide".
I can accomplish this with a simple redirect, but the browser will show "https://www.domain.com:223/user/guide" in the browser.
I want the redirect to occur but the browser to show what the user initially typed in after the redirect occurs. So the back end will send them to "https://www.domain.com:223/user/guide" but the browser window maintains "https://www.domain.com/help".
I have been battling with creating an Irule for this (Not the best at it) and below is what I have but it does not work. This iRule is defined in the Virtual Server listening on port 443. The 1st elseif statement is what I am having trouble with.
when HTTP_REQUEST {
log local0. "Request: [HTTP::uri]"
if {[HTTP::uri] contains "joinnow"}{
log local0. "Redirecting to Join Page Do not care if user sees changed URI"
HTTP::redirect "https://domain.com:223/page1
}
elseif {([HTTP::host] eq "domain.com") && ([HTTP::uri] eq "/help")}{
HTTP::header replace Host "domain.com:223"
HTTP::uri "/user/guide[HTTP::uri]"
}
elseif {[HTTP::uri] contains "erase"}{
log local0. "Redirecting to Erase page
HTTP::redirect "https://domain.com:223/remove
}
else {
log local0. "Redirecting to domain.com main page"
HTTP::redirect "https://domain.com:223/main"
}
}
when HTTP_RESPONSE {
log local0. "server address: [IP::server_addr]"
}
Any help would be greatly appreciated.
- James_Quinby_46Historic F5 AccountIt sounds like you're looking for a way to proxy requests for https://www.domain.com/help to https://www.domain.com:223/user/guide.
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