Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/37.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.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
Asp.net 如何删除web.config中的目录?_Asp.net_.htaccess_Iis_Web Config - Fatal编程技术网

Asp.net 如何删除web.config中的目录?

Asp.net 如何删除web.config中的目录?,asp.net,.htaccess,iis,web-config,Asp.net,.htaccess,Iis,Web Config,我努力了,但可能还不够,我只想做到这一点: mysite.com/en =>mysite.com 等等: mysite.com/en/page1 =>mysite.com/page1 <rule name="Redirect to en version" stopProcessing="true"> <match url="(.*)\/en(.*)" /> <action type="Rewrite"

我努力了,但可能还不够,我只想做到这一点:

mysite.com/en =>mysite.com

等等:

mysite.com/en/page1 =>mysite.com/page1

<rule name="Redirect to en version" stopProcessing="true">
                <match url="(.*)\/en(.*)" />
                <action type="Rewrite" url="en/{R:1}" />
            </rule>

很明显,它不起作用,我对regex很着迷


非常感谢你的帮助

您需要从IIS或web.config禁用目录浏览

<configuration>
  <location path="Secured">
    <system.webServer>
      <directoryBrowse enabled="false" />
    </system.webServer>
  </location>
</configuration>