Forum Discussion
Balasubramaniy2
Nimbostratus
Sep 02, 2018Redirect 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 ";; } }
1 Reply
- youssef1
Cumulonimbus
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,
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