Forum Discussion
fazinfar_29104
Nimbostratus
Jan 27, 2009direct the http request to new page
Hello everyone.
I am pretty new on Irules and don't know much about it.
I need to direct the http request to http://www.allforme.com/player
to http://www.allforme.com/main...
hoolio
Cirrostratus
Jan 27, 2009As Wiesmann suggests, you could use an HTTP class to perform the redirection if you're on 9.4 or higher. Else, you could use a simple iRule.
For rewriting the request (as opposed to redirecting to a new location)...
According to RFC2616 you can use a fully qualified reference in the URI. The server must then ignore the host header. But it might be confusing for troubleshooting if you see one hostname in the URI and a different one in the host header. To avoid this, you could use 'HTTP::header replace Host $new_host' to update the host header and HTTP::uri to update the URI:
HTTP::header replace Host "www.allforme.com"
HTTP::uri [string map { /player /maintenance } [HTTP::uri]]
Aaron
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
