我有一个类api,在我的网络项目中有一个函数测试。要调用此函数,我在浏览器中键入链接http://localhost/api/test。现在我的问题是,是否可以调用默认页面,例如index.html,如果我只调用类而不使用像:http://localhost/api这样的函数?
“我不使用ASP.Net”
发布于 2015-05-20 15:02:06
我用web.config文件中的以下代码重定向解决了这个问题。
<configuration>
<system.webServer>
<httpRedirect enabled="true" exactDestination="true" httpResponseStatus="Found">
<add wildcard="*api" destination="/index.htm" />
<add wildcard="*api/" destination="/index.htm" />
</httpRedirect>
</system.webServer>
</configuration>https://stackoverflow.com/questions/30346496
复制相似问题