首先,您的主机需要支持绑定子目录或独立服务器才能实现这一操作。大部分虚拟主机不支持子目录绑定,因此如果是这类主机,则无法实现此功能,这是硬件限制问题。
接下来,进入后台,选择“系统-系统基本参数”,然后添加变量(如下图所示)。
3:开启“支持多站点”选项(是/否),开启后附件、栏目链接、arclist内容将启用绝对网址。
在实现DEDE手机站点和移动站点数据库同步时,可能会遇到图片调用路径的问题。通过开启图片绝对地址,两个站点都可以顺利调用。
4:手机模板中修改CSS、JS等调用路径,添加绝对地址,如下图所示。
5:PC模板中修改识别代码中的跳转路径。
由原来的:
<meta http-equiv="mobile-agent" content="format=xhtml;url={dede:global.cfg_mobileurl/}/index.php">
<meta http-equiv="mobile-agent" content="format=xhtml;url={dede:global.cfg_wap/}/index.php">
原代码:
$fileurl = $activepath.'/'.$filename;
$fileurl = $cfg_cmsurl.$activepath.'/'.$filename;
function replaceurl($newurl)
{
$newurl=str_replace('src="/uploads/allimg/','src="http://你的域名/uploads/allimg/',$newurl);
return $newurl;
}
{dede:field.body function='replaceurl(@me)'/}