Best answer would be "don't use domain masking" because it has many drawbacks including:
- The problem you have - when users leave your site via links to external sites the address bar still shows your domain.
- Different pages within your own site don't change the address bar either, so user's can't bookmark individual pages of your site
- Your favicon won't work
- Search engines will not index your content as if it belonged to
a.com
, because it doesn't - it's still being served by really.long.url.com
- Any RSS feeds advertised by your site will not show up in the address bar on browsers that support this
To avoid these drawbacks, you should configure the DNS for a.com
so it and the www
CNAME are actually pointed at your webserver, and your website can be served from a.com
directly.
Having said that, to solve the question you asked, links to external sites from within a domain masked site should be changed to use the deprecated target="_top"
attribute. This breaks out of the invisible frameset that GoDaddy (and others) use to implement the not-very-clever "domain masking". The source of http://www.a.com/
basically looks something like this:
<frameset rows="100%,*" border="0">
<frame src="http://www.really.long.url.com" frameborder="0" />
</frameset>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…