对于我的IIS网站,我想将所有请求重定向到一个页面.这样做的目的是我想对我的所有Web应用程序使用的数据库(离线)进行一些维护.我在这个网站上运行了大约50个网络应用程序,因此我想避免访问每个应用程序以更改某些内容.我想我可以在machine.config中进行一次更改?任何提示将不胜感激.
se_*_*vel 49
在webconfig中
<rewrite>
<rules>
<rule name="redirect all requests" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" pattern="" ignoreCase="false" />
</conditions>
<action type="Rewrite" url="index.php" appendQueryString="true" />
</rule>
</rules>
</rewrite>
Run Code Online (Sandbox Code Playgroud)
pip*_*eek 11
使所有页面都不可用,可能会停止当前的网站并在其位置创建一个完整的新的完整空白站点.然后为404(找到文件)错误设置自定义错误页面.自定义错误是IIS中网站的属性对话框中的选项卡.只需创建要发送的页面,然后在自定义错误选项卡上更改404条目以指向刚刚创建的新文件.
| 归档时间: |
|
| 查看次数: |
62194 次 |
| 最近记录: |