0

我在这里使用这篇文章让两个域名指向同一个 Joomla 安装,其中一个具有不同的主页。

http://docs.joomla.org/Multiple_Domains_and_Web_Sites_in_a_single_Joomla!_installation (选项 2)

这些站点可以正常打开,第二个域甚至可以进入正确的登录页面。问题是,当在第二个域上时,所有菜单链接都会在新窗口中打开(它们是相对链接,但在 html 中添加了“target=_blank”),我不知道为什么,或者如何阻止它。

在主域上时,所有菜单链接都会在父窗口中正确打开。

这是两个实时链接:

http://www.hustoninsurance.com/ http://tiffinhealthexchange.com/

提前致谢。运行 Joomla 3.0

4

1 回答 1

1

我查看了 tiffinhealth 的页面源,有一个函数 specialtrack() 正在添加 target="_blank"

var specialtrack = new (function() {
[...]
var initialize = function() {
    var links = document.links;

    for (var i = 0, l = links.length; i < l; i++) {
        var match = links[i].pathname.match(whitelist);
        var match_links = links[i].href.match(domain);
        var match_void = links[i].href.match('javascript:void');
        if (typeof match_void == 'undefined' || match_void == null) {
            if (typeof match !== 'undefined' && match !== null) {
                links[i].addEventListener('click',trackpush_downloads,false);
                links[i].setAttribute('target', '_blank');                                  
            }else if (typeof match_links == 'undefined' || match_links == null) {
                links[i].addEventListener('click',trackpush_links,false);
                links[i].setAttribute('target', '_blank');                                  
            }
        }           
    }   
};

该行links[i].setAttribute('target', '_blank');是添加 target="_blank"; 的罪魁祸首。您应该与开发人员一起调查或尝试使用替代解决方案来达到您的目的;也许您也可以避免在同一页面上使用两个跟踪。

此外,在您的源代码中,您有很多绝对 url,包括域名:确保这在两个域之间是一致的,否则页面缓存最终将包含不一致:

   <a href="http://www.hustoninsurance.com/images/Showcases/Locations/99 Ashwood Rd/Group.png">
   <img src="http://tiffinhealthexchange.com/images/Showcases/Locations/99 Ashwood Rd/Group.png" alt="Group.png"/></a>
于 2013-09-24T08:04:46.793 回答