# Synthetics alert for redirects from https to http

**URL:** <https://discuss.elastic.co/t/synthetics-alert-for-redirects-from-https-to-http/336216>\
**Category:** Synthetics\
**Created:** [June 16, 2023, 12:01pm UTC](https://discuss.elastic.co/t/synthetics-alert-for-redirects-from-https-to-http/336216 "2023-06-16T12:01:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexander\_A](https://avatars.discourse-cdn.com/v4/letter/a/9d8465/32.png) [@Alexander\_A](https://discuss.elastic.co/u/Alexander_A)\
**Post date:** [June 16, 2023, 12:01pm UTC](https://discuss.elastic.co/t/synthetics-alert-for-redirects-from-https-to-http/336216/1 "2023-06-16T12:01:01Z")

</div>

Is it possible to configure alarm when site uses http instead of https or when we go to https and then redirected to http? This seems like a not good thing that can be detected by synthetics and created alert/inform message.

---

<div class="post-metadata">

**Author:** ![abdulz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdulz/32/97601_2.png) [@abdulz](https://discuss.elastic.co/u/abdulz)\
**Post date:** [June 20, 2023, 3:20pm UTC](https://discuss.elastic.co/t/synthetics-alert-for-redirects-from-https-to-http/336216/2 "2023-06-20T15:20:02Z")

</div>

Hi @Alexander_A,

For scripted tests (browser monitors), it's quite possible to assert the URL of the visited page.

For example:

This test will **fail** as the page will be redirected from `http` to `https`.

```typescript
step('Goto Github HTTP', async () => {
    await page.goto('http://github.com');

    // Assert URL is HTTP
    expect(page.url().startsWith('http://')).toEqual(true);
});

```

Whereas the following will **pass** :

```typescript
step('Goto Github HTTP', async () => {
    await page.goto('http://github.com');

    // Assert URL is HTTPS
    expect(page.url().startsWith('https://')).toEqual(true);
});

```

So you can define your assertion however you want, and the based on the status of the monitor, you can setup alert.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 18, 2023, 3:20pm UTC](https://discuss.elastic.co/t/synthetics-alert-for-redirects-from-https-to-http/336216/3 "2023-07-18T15:20:58Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
