linux学习记录

  • 首页
  • 入门LINUX
  • 建站
  • Why
  1. 首页
  2. 入门LINUX
  3. 正文

wordpress设置固定连接及http强制跳转https的设置

2020年11月20日 1519点热度 0人点赞 0条评论

自上次《从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的方法:

《从Windows迁移wordpress5.4.2到ubuntu20.04》

标签: apache
最后更新:2020年11月20日

Frank

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

COPYRIGHT © 2020-2024 frank9.com. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

渝ICP备2020014100号-1

渝公网安备50010502504305号