WordPress将我定向到本地主机上的另一个页面

时间:2019-01-05 12:55:02

标签: wordpress redirect moodle

我先安装了Moodle 3.4,然后又安装了WordPress。我安装了MySQL和PHP,并遵循了相应的步骤。登录到localhost / WordPress以继续配置WordPress,但它使我进入Moodle页面。以下是Moodle的config.php文件:

var/www/html/moodle/config.php  

其内容:

<?php  // Moodle configuration file

unset($CFG);
global $CFG;
$CFG = new stdClass();

$CFG->dbtype    = 'mysqli';
$CFG->dblibrary = 'native';
$CFG->dbhost    = 'localhost';
$CFG->dbname    = 'moodle';
$CFG->dbuser    = 'user';
$CFG->dbpass    = 'pass';
$CFG->prefix    = 'mdl_';
$CFG->dboptions = array (
  'dbpersist' => 0,
  'dbport' => '',
  'dbsocket' => '',
  'dbcollation' => 'utf8mb4_unicode_ci',
);

$CFG->wwwroot   = 'http://localhost';
$CFG->dataroot  = '/var/www/html/moodledata';
$CFG->admin     = 'admin';

$CFG->directorypermissions = 0777;

require_once(__DIR__ . '/lib/setup.php');

// There is no php closing tag in this file,
// it is intentional because it prevents trailing whitespace problems!

WordPress的安装位于:

var/www/html/wordpress

这是我在wp-config.php文件中所做的唯一修改。只是更改我的数据。

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress_asesorias');

/** MySQL database username */
define('DB_USER', 'wordpressuser');

/** MySQL database password */
define('DB_PASSWORD', 'pass');

/** MySQL hostname */
define('DB_HOST', 'localhost');

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');


/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');

URL in browser

某些事情一定会引起冲突,但我不知道这是什么。

1 个答案:

答案 0 :(得分:1)

这是因为您$CFG->wwwroot情绪变量。如果您的网络服务器指向'localhost/moodle',请将其更改为/var/www/html。 或者,修改主机文件(对于Linux为/etc/hosts,对于Windows为c:\windows\system32\drivers\etc\hosts),并将备用主机名设置为localhost,然后使用此值更改$CFG->wwwroot var。