求助:在服务器上找不到请求的URL / DIR / DIR

我将服务器操作系统从CentOS 7更改为Ubuntu18.4服务器,复制了所有文件,安装了一个新的Apache Web服务器,导入了DB。网站主页工作几乎都正常,但一旦我点击一个页面,就会得到404错误。 版本信息: PHP 7.2.17-0ubuntu0.18.04.1 Apache/2.4.29 (Ubuntu)

我在谷歌上搜索了一番,唯一可以追踪的是.htaccess文件出错了,所以我试了下WordPress文件,但仍然没有成功:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

仅在站点上调用/Dir或直接调用时才出错404:

root@joeldig:/etc# apachectl -M
Loaded Modules:
 core_module (static)
 so_module (static)
 watchdog_module (static)
 http_module (static)
 log_config_module (static)
 logio_module (static)
 version_module (static)
 unixd_module (static)
 access_compat_module (shared)
 alias_module (shared)
 auth_basic_module (shared)
 authn_core_module (shared)
 authn_file_module (shared)
 authz_core_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 deflate_module (shared)
 dir_module (shared)
 env_module (shared)
 filter_module (shared)
 mime_module (shared)
 mpm_prefork_module (shared)
 negotiation_module (shared)
 php7_module (shared)
 reqtimeout_module (shared)
 rewrite_module (shared)
 setenvif_module (shared)
 status_module (shared)
root@joeldig:/etc#

did you try to refresh the Permalinks? Under Settings