【发布时间】:2021-06-12 07:07:46
【问题描述】:
我有一台安装了 Apache/2.4.6 (CentOS) PHP/7.3.27 和 Wordpress 的服务器。
当我尝试在 Wordpress 上使用永久链接时,出现 404 错误。
重写模块已启用:
$ httpd -M
Output
rewrite_module (shared)
这是我的 httpd.conf
DocumentRoot "/var/www/html"
<Directory "/var/www/html">
Options Indexes FollowSymLinks
Require all granted
AllowOverride All
<Directory>
这是我的 .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
一切似乎都很好,但是当我在 Wordpress 管理员中将永久链接更改为 帖子名称 时,我仍然收到 404 错误。
我希望得到帮助。
【问题讨论】:
-
Wordpress 5.7 版
标签: php wordpress apache mod-rewrite permalinks