Apache默认的工作目录为/var/www/html
而wordpress通常安装在/var/www/html/wordpress下
通过域名访问时需要在域名后加/wordpress
为使可直接通过域名访问wordpress内容,需修改apache的工作目录
首先修改wordpress仪表盘设置
仪表盘—>设置—>常规—>WordPress地址、站点地址
均修改为域名
之后修改Apache的配置文件/etc/httpd/conf/httpd.conf
修改Document root以及Diretory项
将AllowOverride None 更改为 All
重启apachesystemctl restart httpd.service