织梦全站伪静态设置+全套伪静态规则精华教程(4)

                                               <action type="Rewrite" url="/tags.php?/{R:1}/{R:2}" appendQueryString="false" />

                                     </rule>

                                     <rule name="tag列表分页最后有左斜杠">

                                               <match url="^tags/(.*)/([0-9])/(?:(?.*))*$" ignoreCase="false" />

                                               <action type="Rewrite" url="/tags.php?/{R:1}/{R:2}/" appendQueryString="false" />

                                     </rule>

                                     <rule name="搜索页分页">

                    <match url="^search/(.*)-([0-9]+).html$" ignoreCase="false" />

                    <action type="Rewrite" url="/plus/search.php?q={R:1}&amp;PageNo={R:2}&amp;pagesize=2&amp;searchtype=title" appendQueryString="false" />

                </rule>

                                     <rule name="搜索页">

                    <match url="^search/(.*).html$" ignoreCase="false" />

                    <action type="Rewrite" url="/plus/search.php?q={R:1}&amp;pagesize=2&amp;searchtype=title" appendQueryString="false" />

                </rule>

            </rules>

        </rewrite>

    </system.webServer>

</configuration>

 

apache伪静态规则 .htaccess

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

 

#列表页和列表分页

RewriteRule ^plus/list-([0-9]+).html$ plus/list.php?tid=$1

RewriteRule ^plus/list-([0-9]+)-([0-9]+)-([0-9]+).html$ plus/list.php?tid=$1&TotalResult=$2&PageNo=$3     

#内容页和内容分页

RewriteRule ^plus/view-([0-9]+)-([0-9]+).html$ plus/view.php?arcID=$1&pageno=$2

#TAG标签

RewriteRule ^tags.html$ tags.php

RewriteRule ^tags/(.*)(?:(?.*))* tags.php?/$1

RewriteRule ^tags/(.*)/(?:(?.*))*  tags.php?/$1/

RewriteRule ^tags/(.*)/([0-9])(?:(?.*))* tags.php?/$1/$2

RewriteRule ^tags/(.*)/([0-9])/(?:(?.*))*  tags.php?/$1/$2/

#搜索页

RewriteRule ^search/(.*)-([0-9]+).html$  plus/search.php?q=$1&PageNo=$2&pagesize=2&searchtype=title

RewriteRule ^search/(.*).html$  plus/search.php?q=$1&pagesize=2&searchtype=title

nginx伪静态规则

rewrite ^/plus/list-([0-9]+).html$ /plus/list.php?tid=$1;

rewrite ^/plus/list-([0-9]+)-([0-9]+)-([0-9]+).html$ /plus/list.php?tid=$1&totalresult=$2&PageNo=$3;

rewrite ^/plus/view-([0-9]+)-1.html$ /plus/view.php?arcID=$1;

rewrite ^/plus/view-([0-9]+)-([0-9]+).html$ /plus/view.php?aid=$1&pageno=$2;

rewrite ^/tags.html$ /tags.php;

rewrite ^/tags/(.*)(?:(?.*))* /tags.php?/$1;

rewrite ^/tags/(.*)/(?:(?.*))*  /tags.php?/$1/;

rewrite ^/tags/(.*)/([0-9])(?:(?.*))* /tags.php?/$1/$2;

rewrite ^/tags/(.*)/([0-9])/(?:(?.*))*  /tags.php?/$1/$2/;

rewrite ^/search/(.*)-([0-9]+).html$  /plus/search.php?q=$1&PageNo=$2&pagesize=2&searchtype=title;

rewrite ^/search/(.*).html$  /plus/search.php?q=$1&pagesize=2&searchtype=title;

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/5545f72d1e7bd24902b1e5ccc0cd6139.html