zoukankan      html  css  js  c++  java
  • WordPress Nginx的伪静态的设置

    WordPress Nginx的伪静态的设置

    在站点的配置文件中添加 

    在server {} 中添加

     location * {
        if (-f $request_filename/index.html){
                        rewrite (.*) $1/index.html break;
                }
        if (-f $request_filename/index.php){
                        rewrite (.*) $1/index.php;
                }
        if (!-f $request_filename){
                        rewrite (.*) /index.php;
                }
        }

    在wp后台设置 

    下面大致讲一下固定链接设置参数:

    1. %year% 基于文章发布年份,比如2007;
    2. %monthnum% 基于文章发布月份,比如05;
    3. %day% 基于文章发布当日,比如28;
    4. %hour% 基于文章发布小时数,比如15;
    5. %minute% 基于文章发布分钟数,比如43
    6. %second% 基于文章发布秒数,比如33
    7. %postname% 基于文章的postname,其值为撰写时指定的缩略名,不指定缩略名时是文章标题;
    8. %post_id% 基于文章post_id,比如423;
    9. %category% 基于文章分类,子分类会处理成“分类/子分类”这种形式;
    10. %author% 基于文章作者名。
    将上述参数进行组合,即可得到wordpress的固定链接形式。网上常见的几种设置方法:
    /%year%/%monthnum%/%day%/%postname%/
    /%year%/%monthnum%/%postname%/
    /%year%/%monthnum%/%day%/%postname%.html
    /%year%/%monthnum%/%postname%.html
    /%category%/%postname%.html
    /%category%/%post_id%
    /%postname%.html
    /%post_id%.html 我们一般使用这个方式比较好

    访问一下:

  • 相关阅读:
    从针对接口编程到依赖注入
    DataRow 数组转化成DataTable
    Math 类的方法概要
    .net控件
    字符串反转
    DataTable
    Enabled设置为False时,前景色和背景色也不改变的TextBox 并居中
    C# 四舍五入 (解决四舍六入五成双的问题)
    查询最后一条数据
    C# toString()
  • 原文地址:https://www.cnblogs.com/liang2580/p/9147829.html
Copyright © 2011-2022 走看看