简体   繁体   中英

IIS7.5 Direct all requests to one page

I wish to create a site that returns the same html page for all page requests.

For example the same page will be served for all the below requests:

http://holdingsite
http://holdingsite/foo
http://holdingsite/foo/bar
http://holdingsite/foo.aspx
http://holdingsite/foo.html

What configuration is needed to ensure every request is directed to this one page?

If you can, install the URL Rewrite Module

You can then add a rewrite rule to you config

<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="catchall" stopProcessing="true">
                  <match url=".*" />
                  <action type="Rewrite" url="/somepage.htm" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

Nb You can also configure this via IIS once you have installed the module

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM