wordpress网站实现伪静态功能
第一个步骤:在wordpress后台修改页面配置
登录后台---设置---固定链接---自定义结构--/%post_id%.html
第二个步骤:实现nginx伪静态配置
blog.zhangxianwei.com/zhangxianwei.html
第一个部分:
location / {
try_files $uri $uri/ /index.php?$args==$uri;
}
第二个部分: http://blog.zhangxianwei.com/4.html -- 站点目录 ---
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
[root@web01 conf.d]# cat blog.conf
server {
listen 80;
server_name blog.etiantian.org;
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
location / {
root /html/blog;
index index.php index.html;
try_files $uri $uri/ /index.php?$args==$uri;
}
location ~ \.php$ {
root /html/blog;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS on;
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
}
}