伪静态设置

伪静态设置

Nginx规则:

location / {

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

            rewrite ^/watch-([0-9]+)\.html$ /watch.php?id=$1 last;

            rewrite ^/watch-([0-9]+)-([0-9]+)\.html$ /watch.php?id=$1&fxid=$2 last;            

        }

Apache规则:

RewriteEngine on

RewriteBase /

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

RewriteRule ^watch-([0-9]+).html$ /watch.php?id=$1

RewriteRule ^watch-([0-9]+)-([0-9]+).html$ /watch.php?id=$1&fxid=$2

IIS6规则:

[ISAPI_Rewrite]

# 3600 = 1 hour

CacheClockRate 3600

RepeatLimit 32

RewriteRule ^(.*)/list-([0-9]+)\.html$ $1/list\.php?parentid=$2

RewriteRule ^(.*)/watch-([0-9]+)\.html$ $1/watch\.php?id=$2

RewriteRule ^(.*)/watch-([0-9]+)-([0-9]+)\.html$ $1/watch\.php?id=$2&fxid=$3

IIS7-8规则:

<?xml version="1.0" encoding="UTF-8"?>

<configuration>

    <system.webServer>

        <rewrite>

            <rules>

                <clear />

                <rule name="内容1" patternSyntax="ECMAScript" stopProcessing="false">

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

                    

                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

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

                </rule>

                <rule name="内容2" patternSyntax="ECMAScript" stopProcessing="false">

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

                    

                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

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

                </rule>

<rule name="内容3" patternSyntax="ECMAScript" stopProcessing="false">

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

                    

                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

                    <action type="Rewrite" url="{R:1}/watch\.php?id={R:2}&fxid={R:3}" appendQueryString="false" />

                </rule>

            </rules>

        </rewrite>

    </system.webServer>

</configuration>

推广营销 2019-12-01 22:20:41 通过 网页

评论已关闭!