首先下載 https://www.iis.net/downloads/microsoft/url-rewriteweb
在最下方dom
而後在Web.config 文件裏面url
<configuration></configuration>spa
裏面加.net
<system.webServer> <!-- 其它配置 --> <rewrite> <outboundRules> <rule name="AddCrossDomain"> <match serverVariable="RESPONSE_Access_Control_Allow_Origin" pattern=".*" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="true"> <add input="{HTTP_ORIGIN}" pattern="(http(s)?://((.+\.)?domain1\.com|(.+\.)?domain2\.com|(.+\.)?domain3\.com))" /> </conditions> <action type="Rewrite" value="{C:0}" /> </rule> </outboundRules> </rewrite> </system.webServer>
domain2 domain1 domain3 能夠換本身的多域名