我在这里使用这篇文章,让两个域名指向同一个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
我查看了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"的罪魁祸首;您应该与开发人员一起调查或尝试使用替代解决方案来达到您的目的;也许您也可以避免在同一页面上使用两个跟踪。
此外,在您的源中,您有很多绝对网址,包括域名:确保这在两个域中保持一致,否则页面缓存最终将包含不一致:
<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>