zoukankan      html  css  js  c++  java
  • wordpress配置固定链接nginx访问404问题解决方法

    WordPress支持使用固定链接,但是在ngnix环境下,访问页面后出现404,

    其实官方是有文档说明的,需要单独写配置,

    我这边配置的示例代码如下:

    [plain] view plain copy
     
    1. server {  
    2.     listen       80;  
    3.     server_name  www.chaichunyan.com;  
    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. }  
  • 相关阅读:
    tcp/ip协议listen函数中backlog參数的含义
    oracle exp实例
    js21---单体(单例)模式
    js20---接口3种方式
    js19--继承终极版本
    js18--继承方式
    js17---创建对象:构造函数式和原型组合模式、动态原型模式、稳妥构造函数式
    js16--自定义原型对象
    js---15,模拟数组的ecah方法
    js14--原型2
  • 原文地址:https://www.cnblogs.com/weifeng1463/p/8022166.html
Copyright © 2011-2022 走看看