Forum Discussion
Old URL 404, compare URI with external data group file
Thanks for the reply, we understand your reply but not sure how to finish the last part of this.
when HTTP_REQUEST {
setting a variable for the URI
set uri [HTTP::uri]
setting a variable for the external string data group
set v3 $::v3redirects
finds the text after the last / in the URL
string range $uri [expr {[string last / $uri] + 1}] end
}
if 404 and URI matches our external data group
if HTTP_RESPONSE { [HTTP::status] == 404} and { [matchclass $uri equals $v3] }
I think the above is almost correct, what we are stuck ont is if there is a $uri match extract the whole URL from the data group into another variable
Once we have a variable we can then do a 301 redirect to.
Another question, what happens if there is no match ? will you get a 404 or should we handle it with an else statement to our home page for example ?
thanks in advance
Jim
Recent Discussions
Related Content
* 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