track 官网追踪伪静态规则,IIS改nginx,apache
•折腾记录
799
0
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<clear />
<rule name="不带www转向www域名规则" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{HTTP_HOST}" pattern="^duxiuexp.com$" ignoreCase="false" />
</conditions>
<action type="Redirect" url="https://www.duxiuexp.com/{R:1}" redirectType="Found" />
</rule>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Found" />
</rule>
<rule name="track" enabled="true" stopProcessing="false">
<match url="^S/(.+)" />
<conditions logicalGrouping="MatchAny" trackAllCaptures="false" />
<action type="Rewrite" url="track/?irid={R:1}" logRewrittenUrl="false" />
</rule>
<rule name="/ Z-BlogPHP Imported Rule" enabled="true" stopProcessing="true">
<match url="^.*?" ignoreCase="false" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:0}" />
</rule>
<rule name="/ Z-BlogPHP Imported Rule index.php" enabled="true" stopProcessing="true">
<match url="^index.php/.*?" ignoreCase="false" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{REQUEST_FILENAME}" matchType="IsFile" />
</conditions>
<action type="Rewrite" url="index.php/{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
#rewrite ^/(?i)S/(.+)$ /track/?irid=$1 last; 不区分大小写
rewrite ^(.*)/S/(.+)$ $1/track/?irid=$2 last;
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^S/(.+)$ track/?irid=$1
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
RewriteRule ^S/(.+)$ track/?irid=$1 [NC]