Forum Discussion
Chenco_322726
Nimbostratus
Aug 31, 2017Redirect Many urls to homepage
Hello ,
I have a list of many urls on my website which getting 404 error.
I want only the list of the urls to redirect to homepage [ not all the pages on website ]
found how to do it for a specific ...
Jad_Tabbara__J1
Cirrostratus
Aug 31, 2017Hello Chenco,
Create a "String" type data group (in this example dg-404-URIs) add URIs that gets 404 responses status and add the following part to the irule :
when HTTP_REQUEST {
set uri [HTTP::uri]
log local0. "DEBUG $uri"
}
when HTTP_RESPONSE {
if { [HTTP::status] eq "404" } {
if { [matchclass dg-404-URIs eq $uri] } {
HTTP::respond 302 noserver "Location" "https://page.toto.com/" "Connection" "Close"
}
}
}
Hope it helps
Please mark it as answer if it works
Regards
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