Forum Discussion
Sam_Parkes_1110
Nimbostratus
Dec 01, 2006404 redirect based on URI
Hi,
I'm having trouble getting this iRule to work, just needs a simple redirect if a 404 is received but only if a specific URI is requested, I'm pretty new to this so sorry if it simple. What am...
Dec 01, 2006
You'll want to store the URI in a session varaible and then access it in the response. I'm not sure what you were getting at with the comparison in the HTTP_REQUEST event without an if around it...
Something like this should work for you
when HTTP_REQUEST {
set the_uri [HTTP::uri]
}
when HTTP_RESPONSE {
if { ([HTTP::status] equals "404") && ($the_uri equals "/folder/folder2") } {
HTTP::redirect "http://www.mysite.com"
}
}-Joe
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