zoukankan      html  css  js  c++  java
  • shopex下二级目录wordpress伪静态规则写法_SEO教程

    实这几天做服务器,做商城学到很多知识,只是太忙了没有空记录下来分享。

    今天 商城的内容基本已经做好了。在shopex的二级目录下又建了一个wordpress来做SEO优化。

    在wordpress后台做固定链接后发现伪静态没有成功。打开的文章页面是404页面。

    因为Linux服务器是我自己搭建的,伪静态规则要自己写,我在网上查阅了一些规则的写法终于伪静态成功了。

    原伪静态 规则:

    location / {
            index index.html index.php;
            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;
            }
        }
     
    二级目录伪静态规则:
     
    location / {
            index index.html index.php;
            if (-f $request_filename/tanmulili/index.html){
                rewrite (.*) $1/tanmulili/index.html break;
            }
            if (-f $request_filename/tanmulili/index.php){
                rewrite (.*) $1/tanmulili/index.php;
            }
            if (!-f $request_filename){
                rewrite (.*)/tanmulili/index.php;
            }
        }
  • 相关阅读:
    nginx日志模块及日志定时切割
    Nginx学习笔记
    Nginx负载均衡和反向代理
    python--inspect模块
    Python--sys
    Docker 中 MySQL 数据的导入导出
    分布式监控-open-falcon
    《转载》脚本实现从客户端服务端HTTP请求快速分析
    《转载》日志大了,怎么办?用我的日志切割脚本吧!
    《MySQL》一次MySQL慢查询导致的故障
  • 原文地址:https://www.cnblogs.com/shangxia/p/3240598.html
Copyright © 2011-2022 走看看