自上次《从Windows迁移wordpress5.4.2到ubuntu20.04》后,博客一直都稳定运行,今天上去查找资料,突然发现网址居然是xxx.index.php/xxx ;个人不太喜欢index.php这种多余的字符,必须去掉;
进入后台-设置-固定连接,设置文章名.html后缀,保存;然后页面出现404,无法访问了。
以下是解决方案:
我的环境:Ubuntu20.04+apache2
进入/etc/apache2/sites-enable,直接编辑你的conf文件,因为我开启了SSL,这里是编辑wordpress-ssl.conf
新增以下内容:
<Directory /var/www/wordpress>
AllowOverride All
Require all granted
</Directory>
Directory路径填你的网站目录即可。
然后就是:
sudo systemctl reload apache2 #重载配置文件
sudo systemctl restart apache2 #重启apache
顺便备忘一下http跳转https的方法:
文章评论