Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/lua/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iis 为多个链接重写URL或阻止某些链接_Iis_Rewrite - Fatal编程技术网

Iis 为多个链接重写URL或阻止某些链接

Iis 为多个链接重写URL或阻止某些链接,iis,rewrite,Iis,Rewrite,我们有一个网站的以下URL/绑定 test.se.local/* 本地测试/* 测试。se.本地/cms/* test.en.local/cms/* test.se.cms.local/* test.en.cms.local/* test.se.cms.local/cms/* test.en.cms.local/cms/* 如何实现以下重写 test.se.cms.local/*-->test.se.local/* test.en.cms.local/*-->test.en.local/*

我们有一个网站的以下URL/绑定

  • test.se.local/*
  • 本地测试/*
  • 测试。se.本地/cms/*
  • test.en.local/cms/*
  • test.se.cms.local/*
  • test.en.cms.local/*
  • test.se.cms.local/cms/*
  • test.en.cms.local/cms/*
如何实现以下重写

  • test.se.cms.local/*-->test.se.local/*
  • test.en.cms.local/*-->test.en.local/*
  • test.se.local/cms/*-->test.se.cms.local/cms/*
  • test.en.local/cms/*-->test.en.cms.local/cms/*
或者如何阻止IIS上的以下链接

  • test.se.cms.local/*
  • 测试en.cms.local/*
  • test.se.local/cms/*
  • test.en.local/cms/*

IIS版本为IIS7和IIS8

您可以对每个url进行重写:

 <rule name="Rule1" patternSyntax="Wildcard" stopProcessing="true">
     <match url="test.se.cms.local/*" />
     <action type="Rewrite" url="http://test.se.local/{C:2}" />
 </rule>

请说明(或标记)您使用的IIS版本。您好,这是IIS 7和IIS 8