Forum Discussion
f5user_81982
Nimbostratus
Aug 13, 2013irule for 404 redirect
irule for 404 redirect
JRahm
Admin
Aug 13, 2013that assumes of course you have a my404page page defined to respond. You could define this in an iRule by uploading the source to an iFile (named my404page_html in this example) and then respond to requests with it:
when HTTP_REQUEST {
set host [HTTP::host]
set path [HTTP::path]
switch $path {
"/my404page" {
HTTP::respond 200 content [ifile get "my404page_html"]
}
}
}
when HTTP_RESPONSE {
if { [HTTP::status] eq "404" } { HTTP::redirect "https://${host}/my404page?url=${path}" }
}
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