DedeCMS系统TAG标签伪静态设置(下)

2023-12-26 20:02:09

3.设置伪静态规则

我们这里以iis7为例子,设置以下规则:

 

01 <?xml version="1.0" encoding="UTF-8"?>
02  
03 <configuration>
04  
05     <system.webServer>
06  
07         <rewrite>
08  
09             <rules>
10  
11                 <rule name="weather1" stopProcessing="true">
12  
13                     <match url="tags/([^-]+).html$" ignoreCase="true" />
14  
15                     <conditions logicalGrouping="MatchAll">
16  
17                         <add input="{REQUEST_FILENAME}" matchType="IsFile"negate="true" />
18  
19                         <add input="{REQUEST_FILENAME}"matchType="IsDirectory" negate="true" />
20  
21                     </conditions>
22  
23                     <action type="Rewrite" url="/tags.php?/{R:1}"appendQueryString="false" />
24  
25                 </rule>
26  
27                 <rule name="weather2" stopProcessing="true">
28  
29                     <match url="tags/([^-]+)-([0-9]+).html$"ignoreCase="true" />
30  
31                     <conditions logicalGrouping="MatchAll">
32  
33                         <add input="{REQUEST_FILENAME}" matchType="IsFile"negate="true" />
34  
35                         <add input="{REQUEST_FILENAME}"matchType="IsDirectory" negate="true" />
36  
37                     </conditions>
38  
39                     <action type="Rewrite" url="/tags.php?/{R:1}/{R:2}"appendQueryString="false" />
40  
41                 </rule>
42  
43             </rules>
44  
45         </rewrite>
46  
47     </system.webServer>
48  
49 </configuration>
 

可以直接保存为web.config放在站点根目录。

4.重新生成html页面

这个操作就不用说了,全部重新生成下,至此全部修改完毕。

5.预览查看显示结果

至此,我们已经完成了所有的设置