当前位置:论坛首页 > Linux面板 > 讨论

wordpress nginx伪静态规则 固定链接设置为:sample-post

发表在 Linux面板2017-10-27 14:22 [复制链接] 3 3441

Linux系统。 nginx伪静态规则,一直写不对。没写的时候,首页能打开,但是,内页打不开,提示404错误。 固定链接设置为:sample-post
宝塔的服务器,nginx 1.12 PHP 7.1  SQL 5.7 主机 1H2G
使用道具 举报 只看该作者 回复
发表于 2017-10-27 16:51:01 | 显示全部楼层
有没有大哥可以帮帮我?
使用道具 举报 回复 支持 反对
发表于 2018-5-3 08:01:35 | 显示全部楼层
nginx伪静态 我也不会写
使用道具 举报 回复 支持 反对
发表于 2018-5-3 10:27:15 | 显示全部楼层
可以尝试一下这个
  1.     server {  
  2.         listen       80;  
  3.         server_name  yourdoname;  
  4.       
  5.         access_log  /var/log/nginx/access.log  main;  
  6.       
  7.     location / {  
  8.             root /www/data/xxx;  
  9.             index  index.php index.html index.htm;  
  10.       
  11.             if (-f $request_filename/index.html){  
  12.                    rewrite (.*) $1/index.html break;  
  13.             }  
  14.             if (-f $request_filename/index.php){  
  15.                    rewrite (.*) $1/index.php;  
  16.              }  
  17.             if (!-f $request_filename){  
  18.                    rewrite (.*) /index.php;  
  19.              }  
  20.     }  
  21.     rewrite /wp-admin$ $scheme://$host$uri/ permanent;  
  22.       
  23.         location  ~ \.php$ {  
  24.             root /www/data/xxx;  
  25.             fastcgi_pass   127.0.0.1:9000;  
  26.             fastcgi_index  index.php;  
  27.             fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;  
  28.             include        fastcgi_params;  
  29.         }  
  30.     }  
复制代码
使用道具 举报 回复 支持 反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

普通问题处理

论坛响应时间:72小时

问题处理方式:排队(仅解答)

工作时间:白班:9:00 - 18:00

紧急运维服务

响应时间:3分钟

问题处理方式:宝塔专家1对1服务

工作时间:工作日:9:00 - 18:30

宝塔专业团队为您解决服务器疑难问题

点击联系技术免费分析

工作时间:09:00至18:30

快速回复 返回顶部 返回列表