帝国CMS默认伪静态规则提供[7.0|7.2]
笔记 by ecms 2017-10-15 13:41:40

apache下的.htaccess:

C# Code复制内容到剪贴板
  1. RewriteEngine On  
  2. ErrorDocument 404 /404.html  
  3. Rewritebase /  
  4. #信息列表  
  5. RewriteCond %{QUERY_STRING} ^(.*)$  
  6. RewriteRule ^listinfo-(.+?)-(.+?)\.html$ /e/action/ListInfo/index\.php\?classid=$1&page=$2  
  7. #信息内容页  
  8. RewriteCond %{QUERY_STRING} ^(.*)$  
  9. RewriteRule ^showinfo-(.+?)-(.+?)-(.+?)\.html$ /e/action/ShowInfo\.php\?classid=$1&id=$2&page=$3  
  10. #标题分类列表页  
  11. RewriteCond %{QUERY_STRING} ^(.*)$  
  12. RewriteRule ^infotype-(.+?)-(.+?)\.html$ /e/action/InfoType/index\.php\?ttid=$1&page=$2  
  13. #TAGS信息列表页  
  14. RewriteCond %{QUERY_STRING} ^(.*)$  
  15. RewriteRule ^tags-(.+?)-(.+?)\.html$ /e/tags/index\.php\?tagname=$1&page=$2  
  16. #评论列表页  
  17. RewriteCond %{QUERY_STRING} ^(.*)$  
  18. RewriteRule ^comment-(.+?)-(.+?)-(.+?)-(.+?)-(.+?)-(.+?).html$  /e/pl/index\.php\?doaction=$1&classid=$2&id=$3&page=$4&myorder=$5&tempid=$6  
  19. #搜索伪静态  

 

IIS6下的httpd.ini:

C# Code复制内容到剪贴板
  1. [ISAPI_Rewrite]  
  2. # 3600 = 1 hour  
  3. CacheClockRate 3600  
  4. RepeatLimit 32  
  5. #信息列表  
  6. RewriteRule ^(.*)listinfo-(.+?)-(.+?)\.html$ $1/e/action/ListInfo/index\.php\?classid=$2&page=$3  
  7. #信息内容页  
  8. RewriteRule ^(.*)showinfo-(.+?)-(.+?)-(.+?)\.html$ $1/e/action/ShowInfo\.php\?classid=$2&id=$3&page=$4  
  9. #标题分类列表页  
  10. RewriteRule ^(.*)infotype-(.+?)-(.+?)\.html$ $1/e/action/InfoType/index\.php\?ttid=$2&page=$3  
  11. #TAGS信息列表页  
  12. RewriteRule ^(.*)tags-(.+?)-(.+?)\.html$ $1/e/tags/index\.php\?tagname=$2&page=$3  
  13. #评论列表页  
  14. RewriteRule ^(.*)comment-(.+?)-(.+?)-(.+?)-(.+?)-(.+?)-(.+?).html$  $1/e/pl/index\.php\?doaction=$2&classid=$3&id=$4&page=$5&myorder=$6&tempid=$7  
  15. #搜索伪静态  

 

IIS7下的web.config:

C# Code复制内容到剪贴板
  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <configuration>  
  3. <system.webServer>  
  4. <!--帝国7.2默认规则 IIS7的rule name不能重复相同-->  
  5. <rewrite>  
  6. <rules>  
  7. <rule name="listinfo">  
  8. <match url="^(.*/)*listinfo-(.+?)-(.+?).html\?*(.*)$" />  
  9. <action type="Rewrite" url="{R:1}/e/action/ListInfo/index.php\?classid={R:2}&page={R:3}" />  
  10. </rule>  
  11. <rule name="showinfo">  
  12. <match url="^(.*/)*showinfo-(.+?)-(.+?)-(.+?).html\?*(.*)$" />  
  13. <action type="Rewrite" url="{R:1}/e/action/ShowInfo.php\?classid={R:2}&id={R:3}&page={R:4}" />  
  14. </rule>  
  15. <rule name="infotype">  
  16. <match url="^(.*/)*infotype-(.+?)-(.+?).html\?*(.*)$" />  
  17. <action type="Rewrite" url="{R:1}/e/action/InfoType/index.php\?ttid={R:2}&page={R:3}" />  
  18. </rule>  
  19. <rule name="tags">  
  20. <match url="^(.*/)*tags-(.+?)-(.+?).html\?*(.*)$" />  
  21. <action type="Rewrite" url="{R:1}/e/tags/index.php\?tagname={R:2}&page={R:3}" />  
  22. </rule>  
  23. <rule name="comment">  
  24. <match url="^(.*/)*comment-(.+?)-(.+?)-(.+?)-(.+?)-(.+?)-(.+?).html\?*(.*)$" />  
  25. <action type="Rewrite" url="{R:1}/e/pl/index.php\?doaction={R:2}&={R:3}&={R:4}&page={R:5}&myorder={R:6}&tempid={R:7}" />  
  26. </rule>  
  27. </rules>  
  28. </rewrite>  
  29. </system.webServer>    
  30. </configuration>  

 

Nginx下伪静态:

C# Code复制内容到剪贴板
  1. rewrite ^([^\.]*)/listinfo-(.+?)-(.+?)\.html$ $1/e/action/ListInfo/index.php?classid=$2&page=$3 last;  
  2. rewrite ^([^\.]*)/showinfo-(.+?)-(.+?)-(.+?)\.html$ $1/e/action/ShowInfo.php?classid=$2&id=$3&page=$4 last;  
  3. rewrite ^([^\.]*)/infotype-(.+?)-(.+?)\.html$ $1/e/action/InfoType/index.php?ttid=$2&page=$3 last;  
  4. rewrite ^([^\.]*)/tags-(.+?)-(.+?)\.html$ $1/e/tags/index.php?tagname=$2&page=$3 last;  
  5. rewrite ^([^\.]*)/comment-(.+?)-(.+?)-(.+?)-(.+?)-(.+?)-(.+?)\.html$  $1/e/pl/index\.php\?doaction=$2&classid=$3&id=$4&page=$5&myorder=$6&tempid=$7 last;  
  6. if (!-e $request_filename) {  
  7. return 404;  
  8. }  

 

 

 

本文来自于:http://www.yoyo88.cn/note/note1/170.html

Powered by yoyo苏ICP备15045725号