·设为首页收藏本站📧邮箱修改🎁免费下载专区📒收藏夹👽聊天室📱AI智能体
返回列表 发布新帖

【三瑞】品牌123默认伪静态规则

352 1
发表于 2021-7-4 17:02:03 | 查看全部 阅读模式

马上注册,免费下载更多dz插件网资源。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
切记,品牌123的伪静态要放在
  1. RewriteRule ^(.*)/([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html(\?(.*))*$ $1/plugin\.php\?id=$2:$3&$5
复制代码

之前才能生效。
=============================================
httpd.ini(已认证)
--------------------------------------------------------------------------------------------
  1. RewriteRule ^(.*)/brand\.html(\?(.*))*$ $1/plugin\.php\?id=sanree_brand&$3
  2. RewriteRule ^(.*)/brand-index-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/plugin\.php\?id=sanree_brand&mod=list&tid=$2&did=$3&filter=$4&listmode=$5&$6
  3. RewriteRule ^(.*)/brand-(.+)-([0-9]+)\.html(\?(.*))*$ $1/plugin\.php\?id=sanree_brand&mod=$2&tid=$3&$5
  4. RewriteRule ^(.*)/b/([a-z0-9]+)\.html(\?(.*))*$ $1/plugin\.php\?id=sanree_brand&mod=brandno&tid=$2&$4
复制代码

==========================================

.htaccess(已认证)
-----------------------------------------------------------------------------------------
  1. RewriteCond %{QUERY_STRING} ^(.*)$
  2. RewriteRule ^brand\.html$ plugin.php?id=sanree_brand&%1
  3. RewriteCond %{QUERY_STRING} ^(.*)$
  4. RewriteRule ^brand-index-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)\.html$ plugin.php?id=sanree_brand&mod=list&tid=$1&did=$2&filter=$3&listmode=$4&%1
  5. RewriteCond %{QUERY_STRING} ^(.*)$
  6. RewriteRule ^brand-(.+)-([0-9]+)\.html$ plugin.php?id=sanree_brand&mod=$1&tid=$2&%1
  7. RewriteCond %{QUERY_STRING} ^(.*)$
  8. RewriteRule ^b/([a-z0-9]+)\.html$ $1/plugin.php?id=sanree_brand&mod=brandno&tid=$1&%1
复制代码

==========================================

httpd.conf
===========================================
  1. <IfModule mod_rewrite.c>
  2. RewriteEngine On
  3. RewriteRule ^(.*)/brand\.html\?*(.*)$ $1/plugin.php?id=sanree_brand&$2
  4. RewriteRule ^(.*)/brand-index-(.+)-(.+)-(.+)-(.+)\.html\?*(.*)$ $1/plugin.php?id=sanree_brand&mod=list&tid=$2&did=$3&filter=$4&listmode=$5&$6
  5. RewriteRule ^(.*)/brand-(.+)-(.+)\.html\?*(.*)$ $1/plugin.php?id=sanree_brand&mod=$2&tid=$3&$5
  6. RewriteRule ^(.*)/b/(.+)\.html\?*(.*)$ $1/plugin.php?id=sanree_brand&mod=brandno&tid=$2&$4
  7. </IfModule>
复制代码

===============================================
Web.Config(已认证)
===============================================
               
  1. <rule name="sanree_brand_home">
  2.                         <match url="^(.*/)*brand.html\?*(.*)$" />
  3.                         <action type="Rewrite" url="{R:1}/plugin.php\?id=sanree_brand&{R:2}" />
  4.                 </rule>               
  5.                
  6.                 <rule name="sanree_brand_cate">
  7.                         <match url="^(.*/)*brand-index-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+).html\?*(.*)$" />
  8.                         <action type="Rewrite" url="{R:1}/plugin.php\?id=sanree_brand&mod=list&tid={R:2}&did={R:3}&filter={R:4}&listmode={R:5}&{R:6}" />
  9.                 </rule>      
  10.                
  11.                 <rule name="sanree_brand_item">
  12.                         <match url="^(.*/)*brand-(.+)-([0-9]+).html\?*(.*)$" />
  13.                         <action type="Rewrite" url="{R:1}/plugin.php\?id=sanree_brand&mod={R:2}&tid={R:3}&{R:4}" />
  14.                 </rule>      
  15.                
  16.                 <rule name="sanree_brand_short">
  17.                         <match url="^(.*/)*b/([0-9]+).html\?*(.*)$" />
  18.                         <action type="Rewrite" url="{R:1}/plugin.php\?id=sanree_brand&mod=brandno&tid={R:2}&{R:3}" />
  19.                 </rule>
复制代码

      
==============================================
Nginx伪静态规则:
  1. rewrite ^([^\.]*)/brand\.html$ $1/plugin.php?id=sanree_brand last;
  2. rewrite ^([^\.]*)/brand-index-(.+)-(.+)-(.+)-(.+)\.html$ $1/plugin.php?id=sanree_brand&mod=list&tid=$2&did=$3&filter=$4&listmode=$5 last;
  3. rewrite ^([^\.]*)/brand-(.+)-(.+)\.html$ $1/plugin.php?id=sanree_brand&mod=$2&tid=$3 last;
  4. rewrite ^([^\.]*)/b/(.+)\.html$ $1/plugin.php?id=sanree_brand&mod=brandno&tid=$2 last;
复制代码


我要说一句 收起回复
一花一世界,一叶一追寻。一曲一场叹,一生为一人。

评论1

Discuz智能体Lv.8 发表于 2025-3-16 11:28:32 | 查看全部
感谢您提供详细的伪静态规则信息。以下是对您提供的伪静态规则的简要说明和优化建议:

### 1. **Apache (.htaccess) 伪静态规则**
  1. RewriteCond %{QUERY_STRING} ^(.*)$
  2. RewriteRule ^brand\.html$ plugin.php?id=sanree_brand&%1
  3. RewriteCond %{QUERY_STRING} ^(.*)$
  4. RewriteRule ^brand-index-(+)-(+)-(+)-(+)\.html$ plugin.php?id=sanree_brand&mod=list&tid=$1&did=$2&filter=$3&listmode=$4&%1
  5. RewriteCond %{QUERY_STRING} ^(.*)$
  6. RewriteRule ^brand-(.+)-(+)\.html$ plugin.php?id=sanree_brand&mod=$1&tid=$2&%1
  7. RewriteCond %{QUERY_STRING} ^(.*)$
  8. RewriteRule ^b/(+)\.html$ $1/plugin.php?id=sanree_brand&mod=brandno&tid=$1&%1
复制代码


**说明:**
- 这些规则用于将用户友好的URL重写为Discuz插件`sanree_brand`的实际处理URL。
- `RewriteCond %{QUERY_STRING} ^(.*)$` 用于捕获查询字符串并将其附加到重写后的URL中。

**优化建议:**
- 确保这些规则放置在`.htaccess`文件的顶部,以避免与其他规则冲突。
- 如果服务器支持,可以考虑将规则直接放置在`httpd.conf`中以提高性能。

### 2. **IIS (Web.Config) 伪静态规则**
  1. <rewrite>
  2.     <rules>
  3.         <rule name="brand">
  4.             <match url="^brand\.html$" />
  5.             <action type="Rewrite" url="plugin.php?id=sanree_brand&{R:1}" />
  6.         </rule>
  7.         <rule name="brand-index">
  8.             <match url="^brand-index-(.+)-(.+)-(.+)-(.+)\.html$" />
  9.             <action type="Rewrite" url="plugin.php?id=sanree_brand&mod=list&tid={R:1}&did={R:2}&filter={R:3}&listmode={R:4}&{R:5}" />
  10.         </rule>
  11.         <rule name="brand-mod">
  12.             <match url="^brand-(.+)-(.+)\.html$" />
  13.             <action type="Rewrite" url="plugin.php?id=sanree_brand&mod={R:1}&tid={R:2}&{R:3}" />
  14.         </rule>
  15.         <rule name="brandno">
  16.             <match url="^b/(.+)\.html$" />
  17.             <action type="Rewrite" url="plugin.php?id=sanree_brand&mod=brandno&tid={R:1}&{R:2}" />
  18.         </rule>
  19.     </rules>
  20. </rewrite>
复制代码


**说明:**
- 这些规则用于IIS服务器,将用户友好的URL重写为Discuz插件`sanree_brand`的实际处理URL。
- `{R:1}`、`{R:2}`等是捕获组,用于捕获URL中的动态部分。

**优化建议:**
- 确保IIS的URL重写模块已安装并启用。
- 如果规则不生效,检查IIS的日志文件以获取更多信息。

### 3. **Nginx 伪静态规则**
  1. rewrite ^(*)/brand\.html$ $1/plugin.php?id=sanree_brand last;
  2. rewrite ^(*)/brand-index-(.+)-(.+)-(.+)-(.+)\.html$ $1/plugin.php?id=sanree_brand&mod=list&tid=$2&did=$3&filter=$4&listmode=$5 last;
  3. rewrite ^(*)/brand-(.+)-(.+)\.html$ $1/plugin.php?id=sanree_brand&mod=$2&tid=$3 last;
  4. rewrite ^(*)/b/(.+)\.html$ $1/plugin.php?id=sanree_brand&mod=brandno&tid=$2 last;
复制代码


**说明:**
- 这些规则用于Nginx服务器,将用户友好的URL重写为Discuz插件`sanree_brand`的实际处理URL。
- `last`标志表示这是最后一条匹配的规则。

**优化建议:**
- 确保这些规则放置在Nginx配置文件的`server`块中。
- 如果规则不生效,检查Nginx的错误日志以获取更多信息。

### 4. **通用建议**
- **测试规则**:在应用这些规则之前,建议在测试环境中进行测试,以确保它们按预期工作。
- **缓存**:如果网站流量较大,考虑启用缓存以提高性能。
- **安全性**:确保伪静态规则不会暴露敏感信息或导致安全漏洞。

如果您在应用这些规则时遇到任何问题,欢迎随时联系DZ插件网(https://www.dz-x.net/)获取更多帮助。
-- 本回答由 人工智能 AI智能体 生成,内容仅供参考,请仔细甄别。
我要说一句 收起回复

回复

 懒得打字嘛,点击右侧快捷回复【查看最新发布】   【应用商城享更多资源】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

AI智能体
投诉/建议联系

discuzaddons@vip.qq.com

未经授权禁止转载,复制和建立镜像,
如有违反,按照公告处理!!!
  • 联系QQ客服
  • 添加微信客服

联系DZ插件网微信客服|最近更新|Archiver|手机版|小黑屋|DZ插件网! ( 鄂ICP备20010621号-1 )|网站地图 知道创宇云防御

您的IP:3.138.118.56,GMT+8, 2025-3-29 19:31 , Processed in 0.363194 second(s), 74 queries , Gzip On, Redis On.

Powered by Discuz! X5.0 Licensed

© 2001-2025 Discuz! Team.

关灯 在本版发帖
扫一扫添加微信客服
QQ客服返回顶部
快速回复 返回顶部 返回列表