WordPress使用相对路径访问

wp-config.php文件最后加上下面代码:

/*设置相对路径*/
$home = 'http://'.$_SERVER['HTTP_HOST'];

$siteurl = 'http://'.$_SERVER['HTTP_HOST'];

define('WP_HOME', $home);

define('WP_SITEURL', $siteurl);

加上后,路径会随访问域名变化。

你可能感兴趣的:(CMS,WordPress)