added rewrite rules for IIS, thx <h@reimu.pw>

This commit is contained in:
printempw 2016-03-26 18:01:53 +08:00
parent ec78b27939
commit f89b8efe04
3 changed files with 39 additions and 2 deletions

View File

@ -1,7 +1,9 @@
RewriteEngine on
RewriteBase /
RewriteRule ^([^/]*).json$ get.php?type=json&uname=$1 [L]
RewriteRule ^(skin|cape)/([^/-]*)(|-)(|alex|steve).png$ get.php?type=$1&model=$4&uname=$2 [L]
# 以下是可选内容
# 同时支持 UniSkinAPI 和 CustomSkinLoader API
RewriteRule ^(usm|csl)/([^/]*).json$ get.php?type=json&uname=$2&api=$1 [L]
RewriteRule ^(usm|csl)/textures/(.*)$ textures/$2 [L]
# 用于获取皮肤头像

View File

@ -42,7 +42,6 @@
```
rewrite ^/([^/]*).json$ /get.php?type=json&uname=$1 last;
rewrite ^/(skin|cape)/([^/-]*)(|-)(|alex|steve).png$ /get.php?type=$1&model=$4&uname=$2 last;
# 以下是可选内容
rewrite ^/(usm|csl)/([^/]*).json$ /get.php?type=json&uname=$2&api=$1 last;
rewrite ^/(usm|csl)/textures/(.*)$ /textures/$2 last;
# 用于获取皮肤头像

36
web.config Normal file
View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension="." mimeType="image/png" />
<remove fileExtension=".woff"/>
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
<remove fileExtension=".woff2"/>
<mimeMap fileExtension=".woff2" mimeType="application/x-font-woff2" />
</staticContent>
<rewrite>
<rules>
<rule name="rule 1I" stopProcessing="true">
<match url="^([^/]*).json$" />
<action type="Rewrite" url="/get.php?type=json&amp;uname={R:1}" />
</rule>
<rule name="rule 2I" stopProcessing="true">
<match url="^(skin|cape)/([^/-]*)(|-)(|alex|steve).png$" />
<action type="Rewrite" url="/get.php?type={R:1}&amp;model={R:4}&amp;uname={R:2}" />
</rule>
<rule name="rule 3I" stopProcessing="true">
<match url="^(usm|csl)/([^/]*).json$" />
<action type="Rewrite" url="/get.php?type=json&amp;uname={R:2}&amp;api={R:1}" />
</rule>
<rule name="rule 4I" stopProcessing="true">
<match url="^(usm|csl)/textures/(.*)$" />
<action type="Rewrite" url="/textures/{R:2}" />
</rule>
<rule name="rule 5I" stopProcessing="true">
<match url="^avatar/(|[0-9]*/)([^/-]*).png$" />
<action type="Rewrite" url="/get.php?type=avatar&amp;uname={R:2}&amp;size={R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>