Jim
Jim

Reputation: 3

how to stop people from sharing your website page link?

Is there a way for to make a page link on my website non-shareable, that is, if I share a link to this page with anyone else will not be able to access it, it can only be accessed from the source

Upvotes: 0

Views: 3503

Answers (2)

randomcoder
randomcoder

Reputation: 646

If you have a URL to the website you want it to be accessed from, you can check before you load the page if they came from it, if they didn't just close the tab or something, or display a message.

var oldURL = document.referrer;
if(oldURL!="YOURSITEURL.COM"){
   location.replace("WHEREVER.COM")
}

Upvotes: 0

EthanB
EthanB

Reputation: 4289

Some possibilities (not all of which are created equal):

  • Authorization: require users to authenticate themselves, then restrict who has access to the specific URL(s).
  • Don't use URLs: Instead, use a single-page app that doesn't modify the URL.
  • Just be random: Make every link point to a dynamically-generated URL that can only be visited once.

Upvotes: 0

Related Questions