Joomla一个Joomla安装的多个域名

时间:2013-09-24 01:23:37

标签: joomla joomla3.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

1 个答案:

答案 0 :(得分: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>