4

I've been working on a website and recently noticed some strange behavior regarding links.

When I click on a link on that site in Chrome, Firefox, or Safari, the links don't work.*

However the site is simply a masked redirect to a secondary site on a different domain, and when I go directly to that secondary site, the links work fine. The masked redirect is implemented by Namecheap.

I've looked over the code for a while now, and the links seem to be formatted properly to my untrained eye. I also tried validating the HTML, and while there are some errors, none of those errors seem to be relevant to this link behavior.

Any suggestions on how I can fix it?

*The links don't work when I click directly on them, but they do work if I Cmd-click on them (I'm running Mac OS X, but I expect similar behavior if I Ctrl-clicked on them while running Windows.)

m81
  • 2,217
  • 5
  • 31
  • 47
  • 1
    Hmm, perhaps check out this question: http://stackoverflow.com/questions/4210155/how-do-i-unmask-a-link-from-my-domain-masked-site-to-an-external-site and answer. The chosen answer discusses some drawbacks of domain masking. – sqsinger Apr 02 '16 at 16:41

1 Answers1

0

Yes, masked domains DO affect external links. When you mask a domain, many services simply put the target site within a frame or iframe. That's what is happening here, as evident from viewing the source of http://stanfordjamaicans.org/:

<frameset rows='100%, *' frameborder=no framespacing=0 border=0>
<frame src="https://www.stanford.edu/~mchenja/sj/" name=mainwindow frameborder=no framespacing=0 marginheight=0 marginwidth=0></frame>
</frameset>


A few possible solutions:

0) Fast/sloppy: set up external links to use the deprecated target="_top" attribute, e.g. <a href="https://www.linkedin.com/in/mchenja" class="member-name" target="_top">. This way, the link will affect the whole document, not just the frame.

1) register the CNAME for http://stanfordjamaicans.org/ to point to your web server directly.

2) Use a redirect.

Interesting question - I learned something in answering it. See also: How do I unmask a link from my domain masked site to an external site? -- a related question that explains some drawbacks of domain masking.

Community
  • 1
  • 1
sqsinger
  • 500
  • 1
  • 3
  • 13