如何设置根目录访问WordPress而不是XAMPP

如何设置根目录访问Wordpress而不是XAMPP

第一步

打开XAMPP的安装路径:xampphtdocs

第二步

打开该路径下的 index.php 文件

第三步

该文件内容为:

<?php
    if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) {
        $uri = 'https://';
    } else {
        $uri = 'http://';
    }
    $uri .= $_SERVER['HTTP_HOST'];
    header('Location: '.$uri.'/xampp/');
    exit;
?>
Something is wrong with the XAMPP installation :-(

将其中

header('Location: '.$uri.'/xampp/');

修改成

header('Location: '.$uri.'/(wordpress文件夹名)/');

第四步

保存即可