### [WordPress固定链接怎么设置伪静态](https://www.prosaas.cn/article/8242) **Published:** 2021-07-12T06:51:49 **Author:** 5201314 **Excerpt:** wordpress页面的默认链接形式采用”朴素”方式 (例如: http://域名/?p=123)这样的动态U… ![](//zhiqipro.oss-cn-beijing.aliyuncs.com/2023/12/20231212131013705.jpg) wordpress页面的默认链接形式采用”朴素”方式 (例如: http://域名/?p=123) 这样的动态URL链接不便于搜索引擎的收录, 为此, 我们需设置为其他几种常见的固定链接形式, 如 http://www.sufaith.com 选择的是 【 自定义结构 】. **设置方式如下:** 进入wordpress后台系统首页, 点击菜单 【设置】- 【固定链接】 ![](//zhiqipro.oss-cn-beijing.aliyuncs.com/2023/12/20231212131013693.png) 选择【常用设置】 下的 【自定义结构】 , 可选择单个标签或多个标签组合, 可自定义拼接字符串, 本站点使用的是 /%post\_id%.html, 填写完毕后, 点击 【保存更改】即可生效. ![](//zhiqipro.oss-cn-beijing.aliyuncs.com/2023/12/20231212131013894.png) 保存更改后, 虽然文章或页面的链接变成了固定链接, 但是在访问页面时, 却变成了下载操作, 不能正常访问该URL地址, 这时需要配置nginx的伪静态(URL Rewrite)规则. 以下为nginx的配置, 需修改为你自己的域名和root路径. server {     listen 80;     server\_name www.example.com;     root /usr/local/www/wordpress;     index index.php index.html index.htm;     location / {         try\_files $uri $uri/ /index.php?$args;     }     rewrite /wp-admin$ $scheme://$host$uri/ permanent;     location ~ \\.php$ {         fastcgi\_pass   127.0.0.1:9000;         fastcgi\_index  index.php;         fastcgi\_param  SCRIPT\_FILENAME  $document\_root$fastcgi\_script\_name;         include        fastcgi\_params;     } } 修改完配置后, 重启nginx即可生效, 恢复正常访问. systemctl restart nginx.service 更多WordPress技术文章,请访问**WordPress**教程栏目! 以上就是Wordpress固定链接怎么设置伪静态的详细内容,更多请关注知企PROSAAS其它相关文章! **Tags:** html, http, nginx, WordPress, 字符串, 搜索引擎 **Categories:** WordPress ---