1

I have a website setup in IIS and i add web application under the website. I publish and copy an existing a .Net web application files (aspx file format) over to the web application folder.

When i try to browse the web page from IE, it says

"Protocol Type: localhost" 
"Windows does not recognize this Protocol."

When i try to browse from firefox, it says

"The address wasn't understood"
"Firefox doesn't know how to open this address, because the protocol (localhost) isn't associated with any program."

but when i go to url and click enter (Refresh doesn't work) from firefox, the page works and show the content.

Can anyone please point me the direction of fixing this issue?

4

3 回答 3

3

Browsers look in the beginning of the URL for the protocol that they should use when opening a specific link (And most have functionality to execute other programs if the protocol is not one they understand).

Normally, the protocol is something like "http:", "ftp:", "file:", "irc:", etcetera.

The protocol is delimited by a colon. Your use of localhost:80/... is tripping the browser into thinking that the protocol you are trying to use is "localhost", which is not correct. If you were to leave the port number out, chances are the browser would assume HTTP with default settings (port 80) and it would work fine, seeing as most browsers will assume HTTP if the protocol is not specified.

于 2012-07-03T18:26:40.013 回答
1

"localhost" is not a protocol, it is the name of a server. Your problem is that a colon can serve two functions is a URL: it can separate the protocol from the server, and it can separate the server from the port. You can often leave off the protocol and we assume it is "http". If you have a port number -- "80" in your example -- you must specify the protocol, or we'll confuse the server name for a protocol.

In this example, instead of writing just

localhost:80/AdministrationWebPage/etc

write

http://localhost:80/AdministrationWebPage/etc

If Firefox figures it out, well, good for Firefox, but without the "http://" it's not technically correct.

That is, the general format of a URL is:

protocol://server:port/page?querystring

Browsers and servers will fill in defaults if pieces are missing. But among the rules is that the first colon is supposed to mark the end of the protocol, so:

localhost:80/AdminsitrationWebPage/etc

looks like protocol=localhost, server name=80, which I presume is not what you wanted.

于 2012-07-03T18:24:29.333 回答
0

I got the message above too without inserting the forward slash after I install the apache webserver and test the testing.php file in the htdocs folder

The way I solved it is simply to insert the forward slash as follows: localhost:8000/testing.php

and the content of the testing.php file shows up

于 2013-01-21T05:01:30.447 回答