4.9Redirects
A redirect sends a visitor from one address to another, for example from http:// to https://. obsrvly follows up to 10 redirects. With more, the request fails with a message that contains stopped after 10 redirects.
- Type
redirect.count: how many redirects were followed. It is a number. With no redirect, it is 0. - Type
redirect.final_url: the address where the redirects ended. It is text. With no redirect, it is the address you set.
Operators: eq, neq, gt, lt for the count. eq, neq, contains, matches for the final URL.
| Type | Operator | Value | What it means |
|---|---|---|---|
redirect.final_url | contains | https:// | Visitors always end up on https. |
redirect.final_url | eq | https://www.example.com/ | The bare domain lands on the www site. |
redirect.count | lt | 3 | No long chains of redirects. |
redirect.count | eq | 0 | The address answers directly. |
When it fails: assertion redirect.count == 0: got 2, or assertion redirect.final_url contains "https://": got "http://example.com/". URLs in the message are cut to 80 characters.