So currently, I'm running this code on my webpage in order to detect where the user came from:
if (document.referrer == "https://firsturl.com/") {
window.location.href = "https://secondurl.com/next"
} else if (document.referrer == "https://secondurl.com/") {
location.replace("https://firsturl.com/specialpage")
}
but it isn't adding the first (original) page to history even though I am using location.href for the first redirect. Basically what I want the user to do is to click on a button, then click the back button, and then they'll be on a different page.
By the way, I would appreciate any solutions that don't require AJAX or JQuery.