如何从文件夹映射默认文档文件。那里有一个index.html文件。
sitename.com —> root/folder1
sitename.com/url1 —> root/folder2
sitename.com/url2 —> root/folder3
我配置为
<rule name="rootFolder1" stopProcessing="true">
<match url="^.*$" />
<action type="Rewrite" url="/folder1/{R:0}" />
</rule>
<rule name="rootfolder2" stopProcessing="true">
<match url="^url1.*$" />
<action type="Rewrite" url="/folder2/" />
</rule>
<rule name="rootfolder3" stopProcessing="true">
<match url="^url2.*$" />
<action type="Rewrite" url="/folder3/" />
</rule>
js文件和css文件不适用于该folder2和folder3。它们取自folder1。我该如何解决这个问题?
答案 0 :(得分:0)
决定我的问题
<rule name="rootfolder2" stopProcessing="true">
<match url="url1(.*)" />
<action type="Rewrite" url="/folder2/{R:1}" />
</rule>
<rule name="rootfolder3" stopProcessing="true">
<match url="url2(.*)" />
<action type="Rewrite" url="/folder3/{R:1}" />
</rule>
<rule name="rootfolder1" stopProcessing="true">
<match url="^.*$" />
<action type="Rewrite" url="/folder1/{R:0}" />
感谢lex-li!