wordpress提供多种类型的链接形式

    1/%year%/%monthnum%/%day%/%postname%/

    2/%year%/%monthnum%/%postname%/

    3/%year%/%monthnum%/%day%/%postname%.html

    4/%year%/%monthnum%/%postname%.html

    5/%category%/%postname%.html

    6/%post_id%.html

    7/%postname%/

但是修改固定链接设置后,访问文章会出现404错误,原因是服务器设置不支持wordpress对目录下的.htaccess拥有读写权限。修改方法如下,Nginx服务器rewrite规则配置:

打开宝塔面板,选择配置文件,在server里面加上如下代码即可

location /
{
try_files $uri $uri/ /index.php?$args;
}

rewrite /wp-admin$ $scheme://$host$uri/ permanent;

类似文章