Forum Discussion
iRule and robots.txt
Hi all,
I have an irule that redirects HTTP to HTTPS and adds www (see below). Is it possible to skip enforcing SSL to a page that looks like this http://www.mycompany.com/robots.txt
when HTTP_REQUEST
{ if { [HTTP::host] eq "mycompany.com" } { HTTP::redirect "https://www.mycompany.com" }
elseif { [HTTP::host] eq "www.mycompany.com" } { HTTP::redirect "https://www.mycompany.com" } }
Thank you.
3 Replies
- Arie
Altostratus
when HTTP_REQUEST {
if { ([HTTP::host] equals "mycompany.com") && ( not ([HTTP::path] starts_with "/robots.txt")) } {
HTTP::redirect "https://www.mycompany.com"
} elseif {
([HTTP::host] equals "www.mycompany.com") && ( not ([HTTP::path] starts_with "/robots.txt")) } {
HTTP::redirect "https://www.mycompany.com"
}
}
- Arie
Altostratus
For readability and brevity this might be better: - sbadea_81872
Nimbostratus
Thank you Arie. I'm going to try your suggestion tonight.
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