• 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. }  
  • 相关阅读:
    转载cocos3.17cmake打包
    cocos-lua3.17 Lua tableView工具类
    cocso引擎整体流程
    letCode-1
    letCode-2
    图像语义分割的前世今生
    简要介绍弱监督学*
    win10下乌龟git安装和使用
    STM32F4+Wi-Fi+EDP 向 OneNet 上传数据
    GoogLeNet学习
  • 原文地址:https://www.cnblogs.com/weifeng1463/p/8022166.html
Copyright © 2020-2023  润新知