Forum Discussion
Eugene_Chupkin_
Nimbostratus
Feb 25, 2008iRule to serve up two different robots.txt files for http and https.
My secure and non secure content are in the same DocumentRoot as is pretty standard in many cases. I now have the need to serve up a different robots.txt for anyone who initiates a connection us...
hoolio
Cirrostratus
Feb 25, 2008Hi,
If you created a robots_https.txt on the webserver(s), you could use an iRule to rewrite the request on the HTTPS virtual server. Or you could respond directly from the rule with the HTTPS version of the robots.txt file and leave the web server to answer for the HTTP version.
HTTP::uri (Click here)
HTTP::respond (Click here)
Here is an example of the first option:
Use this rule to rewrite the HTTPS requests to robots.txt to robots_https.txt
when HTTP_REQUEST {
Check if the request is to /robots.txt
if {[HTTP::path eq "/robots.txt"}{
Rewrite the request to /robots_https.txt
HTTP::path /robots_https.txt
}
}Aaron
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
