VS. LocalHost access effectively use IP Access 400 error Invalid hostname Modify method

Source: Internet
Author: User

Today's new site found in the Chrome browser, through localhost access is valid, but through the native IP even 127.0.0.1 access is not valid,

The error in the report is that the Request Invalid HostName

So that the site through two computers access, debugging encountered a small resistance

Here's how to fix it:

1. In the status bar, select the Iispress site, right-click to display all applications

2. Click the site name, select the configuration path in the path indicated below, open the ApplicationHost.config file

3. In the open file, locate the current site in the Binding configuration section, add the following red box configuration

4. There is no 400 situation when accessing the ip+ port in the browser.

Other information:

Visual 2012 and the lower version is the configuration of the ApplicationHost.config file that modifies the document directory

Reference URL: http://stackoverflow.com/questions/28699538/ bad-request-invalid-hostname-with-asp-net-webapi-project-in-visual-studio-2013

VS. LocalHost access effectively use IP Access 400 error Invalid hostname Modify method

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.