wordpress 下多域名支持

修改wp-config.php,在数据库配置下加上如下内容:

# vim wp-config.php
...
// ** MySQL 设置 - 具体信息来自您正在使用的主机 ** //
/** WordPress数据库的名称 */
define('DB_NAME', 'xxx');

/** MySQL数据库用户名 */
define('DB_USER', 'xxx');

/** MySQL数据库密码 */
define('DB_PASSWORD', 'xxx');

/** MySQL主机 */
define('DB_HOST', 'localhost');

/** 创建数据表时默认的文字编码 */
define('DB_CHARSET', 'utf8');

/** 数据库整理类型。如不确定请勿更改 */
define('DB_COLLATE', '');

if (($current_sitename == “justfbt.com”) || ($current_sitename == “www.justfbt.com”) || ($current_sitename
 =="https://wwww.justfbt.com")){
$table_prefix = ‘justfbt_’; // Only numbers, letters, and underscores please!
}elseif (($current_sitename == “sprintman.me”) || ($current_sitename == “www.sprintman.me)){
$table_prefix = ‘sprintman_’; // Only numbers, letters, and underscores please!
}
...
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章