Any way to refuse redirect from a certain domain?

Let’s say my website is “mypage.com”.
Recently, I discovered that someone registered the domain “mypage.xyz” and set it up to redirect to “mypage.com”.
I’m not sure why they’re doing this, but I doubt it’s for a good reason.

I’d like to block redirects coming from the “mypage.xyz” domain.
I tried using a Netlify Edge Function and checking “request.headers.get(‘referer’)”, but it returned “null”.

Is there an effective way to achieve this? Any advice would be greatly appreciated.

No, this is not possible. HTTP redirects don’t have referrer or any other useful headers that you can use to uniquely identify those requests.

1 Like

I kinda had a feeling that it would be impossible, but it’s really too bad that it turned out to be true.
Thank you so much for your reply. it helped me a lot!

1 Like