1

I got the bad habitude to use adf.ly to get some revenue from my small website.

Now I'd like to remove it since it's not allowed in some countries, resulting in a loss of visits and quality service.

So I thought to create an Interstitial Web Page before external URLs instead of using URL Shorteners.

This one will be a sort of html article with a fixed content such as:

You're going to be redirected to an external link. Proceed.

(A countdown could be also a good alternative and I think I'd add a banner at the bottom of this article.)

Do you have any tips for me about how to automatically apply this to all my already existing links? Is it achievable easily?

Thank you all!

PS: No.. it seems my situation is different from the one in that post. Also, I tried the jsfiddle but it wasn't working properly.

EDIT

I'll make it simple.

Let's say the target link is: google.com

Now, I'd like when people click on Google.com to actually reach another page, let's say "http://mywebsite.com/redirect.html" which contains the following:

You'll be redirected to an external link. Proceed.

and then, when the user will click on Proceed, he will finally reach google.com

v3ntus
  • 216
  • 1
  • 13
  • 3
    Off topic: Never use the words "click here" on a website. It's amateurish and not helpful to those using assistive technology. Instead, just link the word "proceed", or use more descriptive words for your link, such as "proceed to ". Also, you're redirecting to a site, not a link. – isherwood Oct 23 '15 at 14:54
  • Thank you so much for your tip :) I'll ensure to put "proceed" and not "click here". (also, on mobile people can't "click" but "tap" so, yes, you're more than right! – v3ntus Oct 23 '15 at 14:55
  • I'm not sure I understand your question. I don't know how AdFly works, but many sites have many external links. Why do your users need a warning? If they do, why not just an icon? – isherwood Oct 23 '15 at 14:57
  • 2
    This actually came up a lot while working on sites for financial institutions. We called them "speed bumps" but I don't know if that's the common term for them or if that language was just particular to that job/office. I've also seen them called [Interstitial web pages](https://en.wikipedia.org/wiki/Interstitial_webpage). – BSMP Oct 23 '15 at 15:00
  • Thank you very much BSMP :) they were called "Interstitial Web Pages" I just forgot that term :) I'll edit the question right now. – v3ntus Oct 23 '15 at 15:02
  • Possible duplicate of [How to detect Link clicks (text, images, etc) with Javascript?](http://stackoverflow.com/questions/8451771/how-to-detect-link-clicks-text-images-etc-with-javascript) – BSMP Oct 23 '15 at 15:37
  • is this just so tha tyou can explicitly tell the user that they are leaving your site and they should not default trust the new site being navigated to, as they trust your site? or is there anything else to it? – gaurav5430 Nov 20 '21 at 14:13
  • why does removing adFly require you to create interstitial pages? – gaurav5430 Nov 20 '21 at 14:15

1 Answers1

1

I assume what you're talking about here is when a user clicks on a link on your page where the host name is different to your host name you will want something like this:

$(document).ready(function() {
   var urlRedirectLandingPage = 'http://somepage.com?redirectUrl=';
   $('a').each(function(a, e) {
     if (e.href.indexOf(window.location.hostname) > -1) {
       return;
     }
     $(e).onclick(function(elem) {
         elem.preventDefault();
         window.location.href = urlRedirectLandingPage + elem.href;
     }
   }
}

Then on that landing page, you would just grab the redirectUrl and redirect to it after X seconds.

P.S Not 100% sure that will work, thats just the jist of it. Doing this on a phone :P

-- Dom

devza
  • 151
  • 1
  • 6