Forum Discussion
Cindy_127211
Nimbostratus
Aug 16, 2006Rewriting Hostname & URI on HTTP_Request without a 'redirect'
I would like to 'rewrite' the following hostname/uri:
http://www.website1.com/index.php?cid=1234
to
http://www.website2.com/app1/index.php?cid=1234
without usin...
JRahm
Admin
Aug 16, 2006You can set the uri and host directly on a request, and forward to a configured pool internal to the system without issuing a redirect:
when HTTP_REQUEST {
if {[HTTP::uri] starts_with "/index.php"} {
HTTP::uri "/app1[HTTP::uri]"
HTTP::host "www.website2.com"
pool your_pool_name
} else {
HTTP::redirect "https://[HTTP::host][HTTP::uri]"
}
}You might want to include additional checks in your if statement to make sure the site is www.website1.com, depending on your requirements.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
