All requests to the ASP Web site jump to the same page

Source: Internet
Author: User
Tags http redirect

Application scenario: When the site is maintained and not developed, it is generally necessary to have all the requests jump to a related description of the page, so that users are not confused whether the site is not there or how.

Solution: In ASP. HttpRedirect is generally used to accomplish related functions.

1. First you need to create a page to be the final jump page, redirect all requests for this site to this page (here is the name: offline.html). You can write the information about your website here, is maintenance, or not developed.

2. Create a Web site in IIS (IIS7, for example), switch to the features View feature interface, locate the HTTP redirect option, and double-click. Tick the "Redirect request to this destination:" option and enter the address of your offline.html (for example: http://localhost:8057/Offline.html). There are also two check boxes in the redirect Behavior box:

"Redirect all requests to exact destination (instead of relative to destination)": Is not a required option to set whether the destination address is an absolute path or a relative path, the default value is False (not checked Selected).

"Only redirect requests to content in this directory (not subdirectories)": Is not a required option: Determines the final destination path based on the redirect path and the request path, the default value is False (unchecked )。

The configuration file for the Web. config that corresponds to the above option is:

  < system.webserver >        <  enabled= "true"  destination= "http://localhost:8057/Offline.html" exactdestination = "false" childonly = "false" />  </ system.webserver >

3. Set status Code: Returns 302 by default, indicating temporary redirection to a new address due to a problem. There are also 301 (for permanent redirection), 307.

4. After setting up, click Apply in the upper right corner. Restart the Web site in IIS, and now all requests are redirected to the destination address.

All requests to the ASP Web site jump to the same page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.