Jump to content

Redirect if referer is not X using URL

Recommended Posts

Site URL: https://www.civicchangemakers.com/codecivic

Hello All:

I want to lock down a page on my site so that it can not be accessed by typing in the direct url. I only want a person to be able to access this specific page if they are coming from a consent page.

This project site (for a virtual hack-a-thon) is for middle and high-school students.  Before they can access the "get-started page" which will have a sign-up form, they will need to first go to the parental consent page (a form) have their parents complete it and then after the consent form is completed, be able to go to the "get started" page. So what I am trying to do is make it so that if a student attempts to gain access to the "get started" page by typing in the url directly they would be redirected to an access denied page.

The project site is https://www.civicchangemakers.com/codecivic

The access denied page is https://www.civicchangemakers.com/codecivic/access-denied

After some research I believe some of the code I am interested in would be utilizing document.referrer in the script, but I do not know where to start.  Also I am not sure if the code should be placed in the site code injection or page code injection.

Any assistance/code would greatly appreciated.






Link to comment
  • Replies 0
  • Views 273
  • Created
  • Last Reply


This topic is now archived and is closed to further replies.

  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.