博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
shopex下二级目录wordpress伪静态规则写法_SEO教程
阅读量:7282 次
发布时间:2019-06-30

本文共 778 字,大约阅读时间需要 2 分钟。

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

 

今天 商城的内容基本已经做好了。在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;
        }
    }

转载于:https://www.cnblogs.com/shangxia/p/3240598.html

你可能感兴趣的文章
SSL和keystore生成、导入等配置
查看>>
The Eagles Hotel California Lyrics
查看>>
软件工程——课程评价
查看>>
OpenStack Placement Project
查看>>
微信支付问题
查看>>
购买类目的概率预测
查看>>
Ajax Step By Step2
查看>>
codeforces 701 B. Cells Not Under Attack
查看>>
当同时安装Python2和Python3后,如何兼容并切换使用详解(比如pip使用)
查看>>
Creating a Custom Page Layout in SharePoint 2013
查看>>
mysql foreignkey
查看>>
Django 中的自定义分页标签
查看>>
[转]ASP.NET自定义控件复杂属性声明持久性浅析
查看>>
PAT (Basic Level) Practise (中文)-卡拉兹(Callatz)猜想
查看>>
第八周进度总结
查看>>
axios 注意点
查看>>
刷新ListView刷新时的闪烁问题
查看>>
cuda c例程学习——eigenvalues(1)
查看>>
通过本地文件数据库查询手机归属地
查看>>
uva 10152 ShellSort
查看>>