WordPress固定链接必须要有index.php,以及出现错误404
内容目录

解决方法1

修改/var/www/html/.htaccess, 但通常该文件是自动生成的,不需要进行修改。

解决方法2

修改/etc/apache2/apache2.conf文件,修改AllowOverride None为All:

<Directory />
        Options FollowSymLinks
        AllowOverride All
        Require all denied
</Directory>

<Directory /usr/share>
        AllowOverride All
        Require all granted
</Directory>

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>

解决方法3

检查Apache web server是否安装了mod_rewrite模块。
通过以下命令安装

sudo a2enmod rewrite

官网文档

使用固定链接的文档

上一篇
下一篇