Referrer based redirect

Created on 7 January 2016, over 8 years ago
Updated 18 April 2024, 2 months ago

Occasionally someone at a partner site will fat finger where a URL is supposed to direct to. Being able to issue a redirect to a landing page based on the referrer URL would be useful in these cases. Is this something that can be implemented?

For example:
Landing page is: http://www.foo.com/bar <--- where we want to go
Link from (www.bar.com) is: http://www.foo.com/foo <--- not where we want to go

So if the module could look for href="http://www.bar.com" and redirect contacts from /foo to /bar on www.foo.com (my site) that would be really handy.

Here's some JavaScript that does this in a really janky the 90's are calling way, unfortunately it also has to be buried in the body of the article (which is obviously very non-Drupalific):

<script type="text/javascript">
/* <![CDATA[ */
if (document.referrer === "http://www.bar.com") {
    window.location.href = "http://www.foo.com/bar";
}
/* ]]> */
</script>
✨ Feature request
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Error_418_

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024