Redirect the /robots.txt request to home page

Hi,

below URL not redirecting the /robots.test request to homepage. kindly help to achieve if request comes https://www.test.com/robots.txt then the request need to forward to homepage https://www.test.com.

Also tried with policy, but not working

when HTTP_REQUEST { if { [string tolower [HTTP::uri]] equals “/robots.ext” } { HTTP::redirect ";; } }

Hi,

remove ;;. try this:

when HTTP_REQUEST { 

if { [string tolower [HTTP::uri]] equals "/robots.ext" } { 
    HTTP::redirect "https://www.test.com"
} 

}

or

when HTTP_REQUEST { 

if { [string tolower [HTTP::uri]] starts_with "/robots." } { 
    HTTP::redirect "https://www.test.com"
} 

}

It will work for sure.

Regards,