如何取消屏蔽从我的域屏蔽站点到外部站点的链接?

发布于 2024-10-03 18:09:33 字数 215 浏览 1 评论 0原文

我注册了域名 www.a.com 然后,我使用屏蔽(使用 GoDaddy)将流量从 www.a.com 转发到 www.really.long.url.com,这样用户在访问我的网站时只会在地址栏中看到 www.a.com。 问题是,如果用户在我的网站上点击 www.google.com 的链接,他们会被定向到 Google,但他们的地址栏仍然显示 www.a.com。

如何禁用外部链接的域屏蔽?

I registered domain www.a.com
I then forwarded with masking (using GoDaddy) traffic from www.a.com to www.really.long.url.com, so users will only see www.a.com in their address bar when visiting my site.
The problem, is that if a user clicks a link to www.google.com while on my website, they get directed to Google, but their address bar still reads www.a.com.

How can I disable this domain masking for external links?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

生生漫 2024-10-10 18:09:33

最好的答案是“不要使用域名屏蔽”,因为它有很多缺点,包括:

  • 您遇到的问题 - 当用户通过外部网站的链接离开您的网站时,地址栏仍然显示您的域名。
  • 您自己网站中的不同页面也不会更改地址栏,因此用户无法为您网站的各个页面添加书签
  • 您的网站图标将不起作用
  • 搜索引擎不会将您的内容编入索引,就好像它属于 a.com,因为它没有 - 它仍然由 really.long.url.com 提供服务
  • 您网站宣传的任何 RSS 提要都不会显示在支持此功能的浏览器的地址栏中

为了避免这些缺点,您应该为 a.com 配置 DNS,以便它和 www CNAME 实际上指向您的网络服务器,并且可以从 为您的网站提供服务>a.com 直接。

话虽如此,为了解决您提出的问题,应将域屏蔽站点内指向外部站点的链接更改为使用已弃用的 target="_top" 属性。这打破了 GoDaddy(和其他人)用来实现不太聪明的“域屏蔽”的不可见框架集。 http://www.a.com/ 的来源基本上如下所示:

<frameset rows="100%,*" border="0">
  <frame src="http://www.really.long.url.com" frameborder="0" />
</frameset>

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>
油焖大侠 2024-10-10 18:09:33

我将添加有关 @Day 提供的解决方案的额外数据:

target="_top" 将使用链接中指定的 url 加载整个当前浏览器窗口(有效删除框架集页面)。

目标

  • _blank = 链接将在新窗口中打开

  • _top = 链接将清除所有现有框架并将 URL 作为最上面的文档打开

  • _parent = 链接将在父框架中打开(如果有几层深)。如果只有一级框架集,则等于 _top
  • _self = 链接将在当前框架/窗口等中打开,以适用者为准

[来源:http://www.webmasterworld.com/forum21/4397.htm]

I'll just add extra data regarding the solution @Day provided:

target="_top" will load the entire current browser window with the url specified in the link (Effectively removing the frameset page).

Target:

  • _blank = Link will open in new window

  • _top = Link will clear any existing frames and open URL as the uppermost document

  • _parent = Link will open in parent frame (if several levels deep). Equal to _top if only one level frameset
  • _self = Link will open in current frame/window etc, whichever is applicable

[source: http://www.webmasterworld.com/forum21/4397.htm ]

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文