当前位置:首页 > 技术分享 > 正文内容

35DIR伪静态

3年前 (2021-10-21)技术分享1894

Apache

<IfModule mod_rewrite.c>
RewriteEngine On
# 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
RewriteRule ^rssfeed\/(.+)/$ index.php\?mod=rssfeed&type=$1
RewriteRule ^rssfeed\/(.+)/(\d+)\.html$ index.php\?mod=rssfeed&type=$1&cid=$2
RewriteRule ^rssfeed\/(.+)$ index.php\?mod=rssfeed&type=$1
RewriteRule ^rssfeed\/(.+)/(\d+)$ index.php\?mod=rssfeed&type=$1&cid=$2
# 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

</IfModule>


Nginx

rewrite ^/(index|webdir|weblink|article|category|update|archives|top|feedback|link|rssfeed|sitemap)(/?)$ /index.php?mod=$1;
rewrite ^/update/(\d+)\.html$ /index.php?mod=update&days=$1;
rewrite ^/update/(\d+)-(\d+)\.html$ /index.php?mod=update&days=$1&page=$2;
rewrite ^/archives/(\d+)\.html$ /index.php?mod=archives&date=$1;
rewrite ^/archives/(\d+)-(\d+)\.html$ /index.php?mod=archives&date=$1&page=$2;
rewrite ^/search/(name|url|tags|intro|br|pr|art)/(.+)-(\d+)\.html$ /index.php?mod=search&type=$1&query=$2&page=$3;
rewrite ^/search/(name|url|tags|intro|br|pr|art)/(.+)\.html$ /index.php?mod=search&type=$1&query=$2;
rewrite ^/(br|pr)/(.+)-(\d+)\.html$ /index.php?mod=search&type=$1&query=$2&page=$3;
rewrite ^/(br|pr)/(.+)\.html$ /index.php?mod=search&type=$1&query=$2;
rewrite ^/view/(\d+)\.html$ /index.php?mod=siteinfo&wid=$1;
rewrite ^/siteinfo/(\d+)\.html$ /index.php?mod=siteinfo&wid=$1;
rewrite ^/siteinfo-(\d+)\.html$ /index.php?mod=siteinfo&wid=$1;
rewrite ^/site/(\d+)-(.+)(/?)\.html$ /index.php?mod=siteinfo&wid=$1;
rewrite ^/artinfo/(\d+)\.html$ /index.php?mod=artinfo&aid=$1;
rewrite ^/linkinfo/(\d+)\.html$ /index.php?mod=linkinfo&lid=$1;
rewrite ^/diypage/(\d+)\.html$ /index.php?mod=diypage&pid=$1;
rewrite ^/rssfeed/(\d+)\.html$ /index.php?mod=rssfeed&cid=$1;
rewrite ^/sitemap/(\d+)\.html$ /index.php?mod=sitemap&cid=$1;
rewrite ^/webdir/(.+)/(\d+)\.html$ /index.php?mod=webdir&cid=$2;
rewrite ^/webdir/(.+)/(\d+)-(\d+)\.html$ /index.php?mod=webdir&cid=$2&page=$3;
rewrite ^/webdir/(.+)/(\d+)-(.+)-(\d+)\.html$ /index.php?mod=webdir&cid=$2&sort=$3&page=$4;
rewrite ^/weblink/(.+)/(\d+)\.html$ /index.php?mod=weblink&cid=$2;
rewrite ^/weblink/(.+)/(\d+)-(\d+)\.html$ /index.php?mod=weblink&cid=$2&page=$3;
rewrite ^/weblink/(.+)/(\d+)-(.+)-(\d+)\.html$ /index.php?mod=weblink&cid=$2&sort=$3&page=$4;
rewrite ^/article/(.+)/(\d+)\.html$ /index.php?mod=article&cid=$2;
rewrite ^/article/(.+)/(\d+)-(\d+)\.html$ /index.php?mod=article&cid=$2&page=$3;
rewrite ^/rssfeed/webdir/ /index.php?mod=rssfeed&type=webdir;
rewrite ^/rssfeed/article/ /index.php?mod=rssfeed&type=article;
rewrite ^/rssfeed/(.+)/(\d+)\.html$ /index.php?mod=rssfeed&cid=$2;
rewrite ^/rssfeed/(.+)/(\d+)/(\d+)\.html$ /index.php?mod=rssfeed&cid=$2&page=$3;
rewrite ^/rssfeed/(.+)/(\d+)-(\d+)\.html$ /index.php?mod=rssfeed&cid=$2&page=$3;


Nginx可能会有些页面会出现404的问题,给我留言

扫描二维码推送至手机访问。

版权声明:本站内容除特殊说明外,本站文章皆由帝明博客原创发布,转载请注明出处。

本文链接:https://www.diming.org/read/6.html

相关文章

怎样解决35DIR分类目录验证码不显示?

怎样解决35DIR分类目录验证码不显示?

       35DIR分类目录是目前国内用的非常多的分类目录源码,因为35DIR已经停止开发,已在用的最新版本都几年前开发的,当时PHP版本基本上是5.2和5.3的,由于php版本从5.4以后,不再...

35DIR分类目录源码常见问题解决办法

     35DIR分类目录还是有非常多站长用的分类目录源码, 因为35DIR已经停止开发,所以源码有很多问题,我把问题整理汇总:1.后台文章管理不能按浏览排序问题    &nbs...

解决Linux ping命令缓慢的方法

Linux系统下是否遇到过ping IP速度很快,但ping一个域名的时候返回非常的慢。通过网上搜索得知,当每次ping完得到响应之后,ping程序会尝试一次反向dns查询(reverse dns lookup)来获取“64 bytes f...

通配符证书有什么用好处?多域通配符证书是什么?

        通配符证书是ssl证书的一种,又称为泛域名ssl证书,它的主要特点是让SSL证书所保护的网站域名变得更加灵活、更有扩展性。通配符证书一般使用*.moemperor.com的形式来匹配它...

什么是CDN加速?CDN加速原理和加速作用有哪些?

什么是CDN加速?CDN加速原理和加速作用有哪些?

        什么是CDN?CDN的全称是Content Delivery Network,即内容分发网络。CDN是在现有Internet基础上增加一层新的网络架构,通过部署边缘服务器,采用负载均衡...

网站域名被恶意泛解析该怎么办?

网站域名被恶意泛解析该怎么办?

     众所周知,域名解析完成后,外部用户才可以通过域名访问网站。那么什么是泛域名解析你知道吗?如果网站被恶意泛域名解析该怎么办?1、什么是泛域名解析?泛解析简单的来讲就是:*.xxx.com解析到一个IP上...