Find any script on your site that forwards visitors to an address written into its link, and limit it to your own pages or remove it. Then check Webmaster Tools for messages about the domain.

A spam email with your address in it

A customer forwards an email to a hardware store in Hope. It claims to be from her bank, and its link begins with the store's own web address.

She clicked because she recognised the store's name. The link passed through the store's site and landed on a page asking for her online banking password.

The site had not been broken into. A small script added years ago to count clicks was doing exactly what it was built to do.

How a click counter becomes a redirect

Some sites count clicks on links to other sites by sending each one through a script of their own. The destination is written into the link, after the script's name.

The script records the click, then forwards the visitor to whatever destination the link names. If it never checks that destination, anyone can write a link that passes through your domain to any page on the internet.

That is called an open redirect. Spammers look for them, because a link that starts with a trusted local business looks safer than one that starts with a strange address.

What the borrowed address costs

The store pays for every message the spammers send:

The second is the slowest to repair. Filters keep a memory of domains seen in spam, and it fades only after the spam stops.

Finding scripts that forward

Look for links on your own site that pass through a script before leaving it. Hover over a link to another site and read the address shown at the foot of the browser window.

Addresses containing words such as go, out, redirect, click or track, followed by a question mark and another web address, are the usual pattern.

Then test each one. Replace the destination in the link with an outside address you choose, and see whether the site sends you there. If it does, the script is open.

Whoever maintains the site can look through its files for redirect code, and through the server's logs for requests to the script carrying outside addresses.

Closing it

Removal is usually the cleanest repair. Point each link straight at its destination, and count outside clicks with Google Analytics events, which record the click without sending anyone through your server.

If the script has to stay, limit it to a list of approved destinations, or to your own pages. Anything not on the list goes to your home page instead.

Removing it outright breaks old newsletter links that used it, so a limited script is often the kinder choice for a site that has sent many.

A worked example

A llama trekking company near Merritt runs half-day and overnight treks from its ranch, and its website lists partner guest ranches, wineries and inns, each with a link.

Years ago a developer routed those links through a script that counted clicks, so the company could tell each partner how many visitors it had sent. The counts had not been read in some time.

This spring a guest phoned to ask why the company was emailing her about a parcel delivery. The link in the message began with the company's address and ended at a fake shipping page.

The test took a minute: an outside address written into the link went straight through. The server's logs showed requests for the script from all over the world, nearly all with destinations it had never linked to.

The partner links now point straight at the partners' sites, with clicks recorded as Analytics events. The old script stays only to serve past links, and it forwards solely to the partners on its list.

A spammer can still write a link that starts with the company's address, but it lands on a partner's site or the trekking home page, which is worth nothing to a scam.

When customers have already seen it

If the messages have already gone out, put a short notice on the home page saying the business did not send them, and how its real emails look.

Answer each customer who asks, and suggest they call their bank if they typed in any details. A plain explanation of the redirect is reassuring; silence leaves them guessing.

Keep the notice up for a few weeks after the redirect is closed, since old messages keep circulating long after the spammers move on.

Watching Webmaster Tools

Webmaster Tools is where Google tells site owners about problems it finds. Check its messages, and the Health section for any malware warning about the site.

Have the messages forwarded to an address someone reads. A warning that sits unread for a month does little good.

If your own email starts landing in junk, tell your host. They can check whether the domain appears on the blocklists filters consult, and how to ask for removal once the redirect is closed.

The counter-case

Not every redirect is a hazard. Redirects from old page addresses to new ones, set up after a redesign, send visitors only to your own pages and should stay.

Nor does every click-counting script need removing. One that checks its destination against a list does no harm, and some sites have good reasons to keep their counts.

The test is narrow: whether anyone, by writing a link, can make your site forward to a page you never chose. If they can, it needs fixing, whatever else the script does.

Closing the redirect

  1. Hover over outside links on your site.
  2. Note any that pass through a script first.
  3. Test each one with an outside address you choose.
  4. Point links straight at their destinations.
  5. Limit or remove any script that stays.
  6. Open any warnings Webmaster Tools has sent.
  7. Ask about blocklists if your mail lands in junk.

Step three is the proof. A script that forwards to any address you type is open, whatever anyone remembers about why it was added.

Who should keep watch over a site between busy seasons, and what to check, is the theme of a seasonal business website left alone all winter.


Frequently asked questions

What is an open redirect?

A script on your site that forwards visitors to any address written into its link. Spammers use it to make harmful links begin with your trusted domain.

Has my site been broken into?

Not necessarily. An open redirect is a design flaw rather than a break-in; the script does what it was built to do for anyone who writes a link.

How do I test for one?

Replace the destination in a link that passes through your site's script with an outside address you choose. If the site sends you there, the script is open.

Can I still count clicks on outside links?

Yes. Google Analytics can record them as events while each link points straight at its destination, so nothing passes through a script on your server.

Why is our own email suddenly going to junk?

Filters learn to distrust domains that appear in spam, including in its links. Close the redirect, then ask your host about the blocklists filters consult.

Should every redirect on the site go?

No. Redirects from old page addresses to new ones only send visitors to your own pages. The problem is a script that forwards to any address at all.

West Coast Media Solutions Inc. provides web design, web development, hosting, digital marketing, and business consulting to organisations across Canada, drawing on more than twenty-five years in the field.

Links on your domain turning up in spam?

Share your site's address, and we will test its scripts for open redirects and close any we find.

Start a Conversation