众所周知,伪静态规则更有利于搜索引擎的收录,对排名也有一定的好处。
但是很多站长朋友都不知道如果来写规则?
DedeCMS特别为大家整理收集了一些常用网站程序的伪静态规则。

WordPress伪静态化rewrite规则

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;  
        }  
    }  
PHPCMS伪静态化rewrite规则

location / { 
rewrite ^(.*)show-([0-9]+)-([0-9]+).html$ $1/show.php?itemid=$2&page=$3; 
rewrite ^(.*)list-([0-9]+)-([0-9]+).html$ $1/list.php?catid=$2&page=$3; 
rewrite ^(.*)show-([0-9]+).html$ $1/show.php?specialid=$2; 

PHPWind伪静态化rewrite规则

location / { 
rewrite ^(.*)-htm-(.*)$ $1.php?$2 last; 
rewrite ^(.*)/simple/([a-z0-9_]+.html)$ $1/simple/index.php?$2 last; 
}

ECSHOP伪静态化rewrite规则

if (!-e $request_filename){ 
rewrite "^/index.html" /index.php last; 
rewrite "^/category$" /index.php last; 
rewrite "^/feed-c([0-9]+).xml$” /feed.php?cat=$1 last; 
rewrite “^/feed-b([0-9]+).xml$” /feed.php?brand=$1 last; 
rewrite “^/feed.xml$” /feed.php last; 
rewrite “^/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)-([0-9]+)-(.+)-([a-zA-Z]+)(.*).html$” /category.php?id=$1&brand=$2&price_min=$3&price_max=$4&filter_attr=$5&page=$6&sort=$7&order=$8 last; 
rewrite “^/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)(.*).html$” /category.php?id=$1&brand=$2&price_min=$3&price_max=$4&filter_attr=$5 last; 
rewrite “^/category-([0-9]+)-b([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*).html$” /category.php?id=$1&brand=$2&page=$3&sort=$4&order=$5 last; 
rewrite “^/category-([0-9]+)-b([0-9]+)-([0-9]+)(.*).html$” /category.php?id=$1&brand=$2&page=$3 last; 
rewrite “^/category-([0-9]+)-b([0-9]+)(.*).html$” /category.php?id=$1&brand=$2 last; 
rewrite “^/category-([0-9]+)(.*).html$” /category.php?id=$1 last; 
rewrite “^/goods-([0-9]+)(.*).html” /goods.php?id=$1 last; 
rewrite “^/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*).html$”  /article_cat.php?id=$1&page=$2&sort=$3&order=$4 last; 
rewrite “^/article_cat-([0-9]+)-([0-9]+)(.*).html$” /article_cat.php?id=$1&page=$2 last; 
rewrite “^/article_cat-([0-9]+)(.*).html$” /article_cat.php?id=$1 last; 
rewrite “^/article-([0-9]+)(.*).html$” /article.php?id=$1 last; 
rewrite “^/brand-([0-9]+)-c([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+).html” /brand.php?id=$1&cat=$2&page=$3&sort=$4&order=$5 last; 
rewrite “^/brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*).html” /brand.php?id=$1&cat=$2&page=$3 last; 
rewrite “^/brand-([0-9]+)-c([0-9]+)(.*).html” /brand.php?id=$1&cat=$2 last; 
rewrite “^/brand-([0-9]+)(.*).html” /brand.php?id=$1 last; 
rewrite “^/tag-(.*).html” /search.php?keywords=$1 last; 
rewrite “^/snatch-([0-9]+).html$” /snatch.php?id=$1 last; 
rewrite “^/group_buy-([0-9]+).html$” /group_buy.php?act=view&id=$1 last; 
rewrite “^/auction-([0-9]+).html$” /auction.php?act=view&id=$1 last; 
rewrite “^/exchange-id([0-9]+)(.*).html$” /exchange.php?id=$1&act=view last; 
rewrite “^/exchange-([0-9]+)-min([0-9]+)-max([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*).html$” /exchange.php?cat_id=$1&integral_min=$2&integral_max=$3&page=$4&sort=$5&order=$6 last; 
rewrite ^/exchange-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*).html$” /exchange.php?cat_id=$1&page=$2&sort=$3&order=$4 last; 
rewrite “^/exchange-([0-9]+)-([0-9]+)(.*).html$” /exchange.php?cat_id=$1&page=$2 last; 
rewrite “^/exchange-([0-9]+)(.*).html$” /exchange.php?cat_id=$1 last; 
}

SHOPEX伪静态化rewrite规则

location / { 
if (!-e $request_filename) { 
rewrite ^/(.+.(html|xml|json|htm|php|jsp|asp|shtml))$ /index.php?$1 last; 
         } 

Discuz 7伪静态化rewrite规则

rewrite ^/archiver/((fid|tid)-[w-]+.html)$ /archiver/index.php?$1 last; 
rewrite ^/forum-([0-9]+)-([0-9]+).html$ /forumdisplay.php?fid=$1&page=$2 last; 
rewrite ^/thread-([0-9]+)-([0-9]+)-([0-9]+).html$ /viewthread.php?tid=$1&extra=page=$3&page=$2 last; 
rewrite ^/space-(username|uid)-(.+).html$ /space.php?$1=$2 last; 
rewrite ^/tag-(.+).html$ /tag.php?name=$1 last; 
discuzX2.0伪静态化rewrite规则

# 将 RewriteEngine 模式打开 
 
RewriteEngine On 
 
# 修改以下语句中的 /discuz 为你的论坛目录地址,如果程序放在根目录中,请将  
 
/discuz 修改为 / 
 
RewriteBase / 
 
# Rewrite 系统规则请勿修改 
 
RewriteCond %{QUERY_STRING} ^(.*)$ 
RewriteRule ^topic-(.+).html$ portal.php?mod=topic&topic=$1&%1 
RewriteCond %{QUERY_STRING} ^(.*)$ 
RewriteRule ^article-([0-9]+)-([0-9]+).html$ portal.php?mod=view&aid=$1&page=$2&%1 
RewriteCond %{QUERY_STRING} ^(.*)$ 
RewriteRule ^forum-(w+)-([0-9]+).html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1 
RewriteCond %{QUERY_STRING} ^(.*)$ 
RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+).html$ forum.php?mod=viewthread&tid=$1&extra=page=$3&page=$2&%1 
RewriteCond %{QUERY_STRING} ^(.*)$ 
RewriteRule ^group-([0-9]+)-([0-9]+).html$ forum.php?mod=group&fid=$1&page=$2&%1 
RewriteCond %{QUERY_STRING} ^(.*)$ 
RewriteRule ^space-(username|uid)-(.+).html$ home.php?mod=space&$1=$2&%1 
RewriteCond %{QUERY_STRING} ^(.*)$ 
RewriteRule ^blog-([0-9]+)-([0-9]+).html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1 
RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^archiver/(fid|tid)-([0-9]+).html$ archiver/index.php?action=$1&value=$2&%1

推荐!各类建站程序伪静态规则代码相关推荐

  1. 有哪些免费好用的开源建站程序/系统,推荐下?

    我推荐WordPress建站程序,学习入门门槛很低,全世界近三分之一的网站都是采用wordpress,所以没有理由不去学习它. 我从一名小白变为wordpress建站老手,对比过很多建站程序,还是觉得 ...

  2. 国内外免费php开源建站程序一览,推荐国内外PHP开源建站程序

    论坛:Discuz Discuz非常流行,也是中国地区最多用户使用的论坛程序,论坛搭建非常简单易用,使用风格符合中国人的口味.另一个流行的论坛程序是PHPWind. 国内PHP开源建站CMS程序一览 ...

  3. 快速免费建站程序推荐,个人站长快速建站程序必知

    暑假马上到了,很多童鞋会在这期间拥有人生中的第一个网站,本文将推荐当下国内比较流行的建站程序,虽然只是个引子,但希望对即将建站的朋友有所帮助. 一,建资讯站 资讯站是多数个人站长首选,而资讯站的CMS ...

  4. 推荐一些国内目前比较流行的建站程序!(不仅仅是CMS内容管理系统)

    (1):基于windows平台的ASP/.NET程序 动易系统(powereasy.net):适合建设中大型网站.有ASP和ASP.NET两种系统. 新云系统(newasp.net):大多数人用这个建 ...

  5. 免费又好用!十大免费建站程序推荐

    选择一个好的建站程序在网站发展过程中尤为重要,根据不同的领域,有着不同的功能需求,但是程序的负载性.安全性.易用性及通用性和后续开发是大 家选择建站程序的共同原则.我们根据华夏名网15万虚拟主机客户( ...

  6. 国内外免费PHP开源建站程序

    互联网上有很多开源建站程序供站长选择,做社区时你在Discuz和PHPWind之间做比较,做资讯网时你在DedeCMS.PHPCMS和Wordpress之间比较,虽然如此,你依然不知道选择什么程序好, ...

  7. 免费开源的建站程序大全,不会编程也可以自助搭建网站了哦

    想建网站又不会编程的小伙伴有福啦,本期推荐一些开源的cms建站程序,不需要写后端的任何逻辑代码,轻轻松松就可以建立自己的网站了,当然,要想网站有自己的个性,模版还是需要自己写的,只需要会简单的html ...

  8. zblog php建站教程_开源建站程序ZBlogPHP博客安装图文教程

    ZBlogPHP是由PHP语言开发的开源博客程序.虽然,zblog也有asp版本的,但是目前以及今后趋势使用php版本才是主流,其程序大小也只有2.3M左右!而我们今天讲解的也是php版本的zblog ...

  9. 帝云CMS-免费可商用的万能PHP建站程序

    帝云CMS内容管理系统是基于PHP7语言采用最新CodeIgniter4作为开发框架生产的网站内容管理框架,提供"电脑网站 + 手机网站 + APP 接口"一体化网站技术解决方案. ...

最新文章

  1. 实战:微信小程序支付开发具体流程
  2. 特殊的求和(函数和循环)
  3. ASP.NET Core IP 请求频率限制
  4. 【渝粤教育】国家开放大学2019年春季 1332中文学科论文写作 参考试题
  5. android 应用在启动后进行全局的的初始化操作
  6. 分类算法之贝叶斯(Bayes)分类器
  7. GitHub的基础使用入门
  8. Spring AOP示例教程 - Aspect,Advice,Pointcut,JoinPoint,Annotations,XML Configuration
  9. 巴铁 无人驾驶_巴铁骗局再现 深圳无人巴士谎言又来忽悠人
  10. solr之搭建企业搜索平台,配置文件详细solrconfig.xml
  11. 夜曲编程python_python入门‼️夜曲编程‼️
  12. 漫画:什么是加密算法?
  13. TSP问题——GA(遗传算法)解法(附源代码)
  14. MAC中文版 FCPX V10.6.5 专属视频剪辑后期工具及其插件安装使用教程
  15. [转载]如何在非443端口开https
  16. 实时票房 麦谈帮API数据接口
  17. 自认为最中肯的“北大”评价吧(转)
  18. 一般计算机电源都在什么服务,1u工控服务器电源与普通电脑电源能互用吗
  19. PTA 显示指定范围的素数并求和《越努力越幸运》
  20. 通知:PostgreSQL证书领取(初级)

热门文章

  1. 看人机对话技术一步步突破与发展
  2. HackBar 新手使用教程
  3. 5G能让你的网盘提速吗?
  4. 关系代数(关系代数的五个基本操作)
  5. NLP实践!文本语法纠错模型实战,搭建你的贴身语法修改小助手 ⛵
  6. numpy中的zeros函数
  7. 2021/12/13 学习笔记:外部表不是预期的格式
  8. 免费虚拟服务器多开软件,云服务器多开模拟器
  9. Python--ndarray 常用属性详解
  10. JavaScript 拷贝 函数方式