shopex下二级目录wordpress伪静态规则写法_SEO教程
2013-08-06 15:13
447 查看
实这几天做服务器,做商城学到很多知识,只是太忙了没有空记录下来分享。
今天 商城的内容基本已经做好了。在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;
}
}
今天 商城的内容基本已经做好了。在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;
}
}
相关文章推荐
- 网站二级目录或者子目录安装 WordPress 伪静态规则设置方法,服务器为nginx
- WordPress程序伪静态规则(Nginx/Apache)及二级目录规则
- Nginx下让WordPress支持伪静态规则及网站下级目录配置伪静态教程
- Nginx常用Rewrite(伪静态规则)WordPress/PHPCMS/ECSHOP/ShopEX/SaBlog/Discuz/DiscuzX/PHPWind/Typecho/DEDECMS
- 伪静态规则写法RewriteRule-htaccess详细语法使用
- 伪静态规则写法RewriteRule-htaccess详细语法使用
- PhpCms,ShopEx,EcShop,WordPress,PhpWind,Discuz在Nginx下的rewrite规则
- 伪静态规则写法RewriteRule-htaccess详细语法使用
- htaccess语法教程 apache服务器伪静态规则教程
- DiscuzX3.1标签(TAG)目录化伪静态修改教程(附规则)
- nginx 静态目录配置规则,路径匹配与本地资源
- win主机下wp博客(WordPress)伪静态设置教程
- Lighttpd下WordPress的伪静态规则,原创测试可用。
- 黄聪:windows主机下wordpress伪静态规则设置
- [亲测可用]ShopEx在Nginx上的的Rewrite伪静态规则
- 对wordpress非插件生成html静态缓存教程的补充,自动更新缓存
- nginx 不同目录静态资源位置 通过二级目录(路径)映射不同的反向代理
- 转--htaccess语法教程 apache服务器伪静态规则教程
- 阿里云ESC Nginx下为WordPress添加伪静态规则
- SEO中目录和文件的命名规则