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...
MrVJTod_64267
Nimbostratus
Aug 26, 2009I have an almost identical code block
when HTTP_REQUEST {
set uri [string tolower [HTTP::uri]]
set host [HTTP::host]
}
when HTTP_RESPONSE {
if {([HTTP::status] equals 404) and ($uri equals "/fnf.asp")} {
log local0. "404 : http://$host$uri"
HTTP::respond 302 Location "http://$host"
}
}
My 404 is logged to /var/log/ltm
But I don't see a response.
Using http://web-sniffer.net, I don't even see a response code.
Using telnet from the BIGIP shell, I get a disconnect message.
telnet {bigip.ip} 80
GET /fnf.asp HTTP/1.0
HOST: {fqdn}
Connection closed by foreign host.
I've tried a few different configurations,
HTTP::redirect,
HTTP::respond 200 Content "content",
HTTP::header replace Status 302
If I comment out the Respond/Redirect, the client sees the 404 message.
But with that line in there, the client sees nothing.
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