wordpress permalinks 初期就应配置好(wordpress使用问题)

(1)apache服务器首先需要启用mod_rewrite模块

sudo a2enmod rewrite //启用Apache mod_rewrite
sudo systemctl restart apache2 //重启apache

(2)修改配置文件: apache2.conf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
sudo vi /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
Require all denied
</Directory>

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

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

保存退出重启apache

sudo service apache2 restart

参考来自wordpress官方文档:

Using Permalinks

后续:我之所以修改固定连接 , 一是因为默认的链接后缀太长.二是SEO(搜索引擎优化)提示优化 , 推荐使用用户名 .

wordpress permalinks

站点健康状态:

如何创建属于自己的网站请点击下面的链接

网站从无到有,比较详细(以我自己的网站为例)