简体   繁体   中英

Check if user is coming from a another page

I'm very new to this, but i need something in javascript made very simple. I have a blog channel where i earn money from shortning links, only problem is everyone is bypassing them but on the site itself i can write javascript code for my monitized links.

So i need way when the user (visitor) is trying to bypass my monitized link on one of those bypass sites it needs to checks if they are coming from a certain domain like 'thebypasser.com' 'linkvertisebypasser.com' etc. If so throw them back with a error to my website blog.

I'd appreciate it very much if anyone could help me out here

No experience in javascript

When the user comes from a specific website (say, google.com ), the request has Referer: https://www.google.com/ header

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referer

This is generally the only information you can obtain from user's browser (the server-side of as website can share some more info)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM