Wordpress 中的永久链接 - 找不到 404 页面 - Raspberry Pi 服务器

Permalinks in Wordpress - 404 Page not found - Raspberry Pi server

我知道这个问题已经被问了很多,但我已经尝试了很多东西,其中 none 有效。当我访问具有非默认永久链接的页面时,出现 404 未找到页面 错误。通过一些研究,我发现这也可能是服务器的问题,这就是为什么我提到我使用 Raspberry Pi 并安装了 Raspian 作为服务器的原因。我正在使用 Apache

我已经尝试过的事情:

我已经尝试过此处显示的解决方案:https://wordpress.org/support/topic/how-to-fix-permalink-postname-404-not-found, and here: Permalinks in Wordpress - Page not found。在其他网站

拜托,如果有任何想法,我将不胜感激,在此先感谢

更新:

我解决了,这里是解决方案:

首先选择您想要的固定链接结构。然后在你的树莓派服务器中:

sudo a2enmod rewrite
sudo service apache2 restart

然后

sudo nano /etc/apache2/apache2.conf

并更改此:

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

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

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

为此:

<Directory />
    Options FollowSymLinks
    AllowOverride All
    Order deny,allow
</Directory>

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

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

重新启动 apache2 服务器

sudo service apache2 restart

它应该可以正常工作