35dir分类目录apache伪静态及apahce转nginx分享

资源分享 老翟笔记 2022-08-14 10:30 299 0

在上篇文章《宝塔面板apache rewrite转nginx rewrite伪静态》中提到了apache转nginx伪静态工具,本是想单纯的给大家分享一个好用的apache转nginx工具,没想到很多网络朋友留言说想要35dir分类目录的nginx伪静态规则。

35dir nginx伪静态.png

应大家强烈要求,小编就把apache的伪静态规则和转换后的nginx伪静态一起分享出来吧。

首先下面代码是apache的伪静态规则:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Rewrite 

# BEGIN
# 首页、分类浏览、数据归档、最近更新、排行榜、意见反馈
RewriteRule ^(index|webdir|weblink|article|category|update|archives|top|feedback|link|rssfeed|sitemap)(\/?)$ index.php\?mod=$1
# 最近更新
RewriteRule ^update/(\d+)-(\d+)\.html$ index.php?mod=update&days=$1&page=$2
RewriteRule ^update/(\d+)\.html$ index.php?mod=update&days=$1
# 数据归档
RewriteRule ^archives/(\d+)-(\d+)\.html$ index.php?mod=archives&date=$1&page=$2
RewriteRule ^archives/(\d+)\.html$ index.php?mod=archives&date=$1
# 站内搜索
RewriteRule ^search/(name|url|tags|intro)/(.+)-(\d+)\.html$ index.php?mod=search&type=$1&query=$2&page=$3
RewriteRule ^search/(name|url|tags|intro)/(.+)\.html$ index.php?mod=search&type=$1&query=$2
# 站点详细
RewriteRule ^siteinfo/(\d+)\.html$ index.php?mod=siteinfo&wid=$1
# 文章详细
RewriteRule ^artinfo/(\d+)\.html$ index.php?mod=artinfo&aid=$1
# 链接列表
RewriteRule ^weblink/(\d+)\.html$ index.php?mod=weblink&page=$1
# 链接详细
RewriteRule ^linkinfo/(\d+)\.html$ index.php?mod=linkinfo&lid=$1
# 单页
RewriteRule ^diypage/(\d+)\.html$ index.php?mod=diypage&pid=$1
# RSS
RewriteRule ^rssfeed/(webdir|article)-(\d+)\.html$ index.php?mod=rssfeed&type=$1&cid=$2
RewriteRule ^rssfeed/(webdir|article)\.html$ index.php?mod=rssfeed&type=$1
# SiteMap
RewriteRule ^sitemap/(webdir|article)-(\d+)\.html$ index.php?mod=sitemap&type=$1&cid=$2
RewriteRule ^sitemap/(webdir|article)\.html$ index.php?mod=sitemap&type=$1
# 分类目录
RewriteRule ^webdir-(.+)-(\d+)-(\d+)\.html$ index.php\?mod=webdir&cid=$2&page=$3
RewriteRule ^webdir\/(.+)\/(\d+)-(\d+)\.html$ index.php\?mod=webdir&cid=$2&page=$3
RewriteRule ^webdir\/(.+)\/(\d+)/(\d+)$ index.php\?mod=webdir&cid=$2&page=$3
RewriteRule ^article-(.+)-(\d+)-(\d+)\.html$ index.php\?mod=article&cid=$2&page=$3
RewriteRule ^article\/(.+)\/(\d+)-(\d+)\.html$ index.php\?mod=article&cid=$2&page=$3
RewriteRule ^article\/(.+)\/(\d+)/(\d+)$ index.php\?mod=article&cid=$2&page=$3
# END

动手能力的朋友可以根据文章开头说的方法自行去转换,如果大家嫌麻烦或者自行转换不成功的话,可以关注本站微信公众号:老翟笔记,回复关键词“35dir伪静态转换”获取下载链接及提取码。

  • 随机文章
  • 热门文章
  • 热评文章

评论区