【问题标题】:Joomla Multiple Domain names for one Joomla Install一个 Joomla 安装的 Joomla 多个域名
【发布时间】:2013-09-24 01:23:36
【问题描述】:

我在这里使用这篇文章让两个域名指向同一个 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

【问题讨论】:

  • 您使用的 Google Analytics(分析)插件/模块的名称是什么?

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-07-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-10-15
    相关资源
    最近更新 更多