Forum Discussion
abdullah_alshah
Nimbostratus
Jan 07, 2018blocking uri
hi, i need to block all uri on the website with below iRule but not working fine:
when HTTP_REQUEST { if { [string tolower [HTTP::host]] contains "; and ($uri contains "/")} { HTTP::redirect ";
}
}
please help me.
- kolom_265617
Cirrostratus
Try using the following:
when HTTP_REQUEST { if { ([string tolower [HTTP::host]] contains "www.example.com") && ( [string tolower [HTTP::uri]] contains "/") } { HTTP::redirect https://www.test.com } }
- abdullah_alshah
Nimbostratus
many thanks brothers for the response and grate efforts.
- kolom
Altostratus
Try using the following:
when HTTP_REQUEST { if { ([string tolower [HTTP::host]] contains "www.example.com") && ( [string tolower [HTTP::uri]] contains "/") } { HTTP::redirect https://www.test.com } }
- abdullah_alshah
Nimbostratus
many thanks brothers for the response and grate efforts.
- Stanislas_Piro2
Cumulonimbus
URI condition is useless as / is in every requests.
try this code
when HTTP_REQUEST { if { [string tolower [HTTP::host]] equals "www.example.com"} { HTTP::redirect https://www.test.com } }
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