Turn locahost into com

M

Mark Goldin

Is it possible (for testing purposes) turn a locahost into somename.com?

Thanks
 
D

Dave Anderson

Mark Goldin said:
Is it possible (for testing purposes) turn a locahost into somename.com?

If you add an entry to your hosts file, sure.

Start
Run
notepad.exe c:\windows\system32\drivers\etc\hosts
 
E

Evertjan.

Mark Goldin wrote on 27 sep 2007 in
microsoft.public.inetserver.asp.general:
Is it possible (for testing purposes) turn a locahost into somename.com?

Not with ASP.

ASP is a serverside platform, so cannot change your pc.
 
D

Dave Anderson

Mark Goldin said:
192.168.1.75 mark #PRE #DOM:testing
I am trying to add this line.
But http://mark.testing:8080/ does not work while
http://192.168.1.75:8080/ works fine. What am I doing wrong?

In the IIS console, check the [Advanced...] web site identification
properties to ensure that the host headers are accounted for if you have
more than one web site running.

You actually asked about "localhost". Why are you not doing this?

127.0.0.1 mark

Or for that matter, why not just use "http://localhost:8080" ?
 
J

jp2code

Neat stuff, Mr. Anderson.

I tried it out (just because it was there):

127.0.0.1 localhost
127.0.0.1 yahoo.com

but yahoo.com still went to Yahoo's site - not my localhost.

Is a reboot required?

On the other hand, I replaced all of Windows default files in
"C:\Inetpub\wwwroot" with a web page I had created some time ago. Now, all I
need to do to test the page is browse over to http://localhost.

Learning new stuff is always fun.
 
M

Mark Goldin

<ensure that the host headers are accounted
Not sure how to do that.

Dave Anderson said:
Mark Goldin said:
192.168.1.75 mark #PRE #DOM:testing
I am trying to add this line.
But http://mark.testing:8080/ does not work while
http://192.168.1.75:8080/ works fine. What am I doing wrong?

In the IIS console, check the [Advanced...] web site identification
properties to ensure that the host headers are accounted for if you have
more than one web site running.

You actually asked about "localhost". Why are you not doing this?

127.0.0.1 mark

Or for that matter, why not just use "http://localhost:8080" ?


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message.
Use of this email address implies consent to these terms.
 
D

Dave Anderson

jp2code said:
I tried it out (just because it was there):

127.0.0.1 localhost
127.0.0.1 yahoo.com

but yahoo.com still went to Yahoo's site - not my localhost.

I just tried it on my machine and got the localhost -- on IE only. And IE
seems to cache the IP in a way that requires a restart (of IE, not of
Windows) if you make the change.
 
J

jp2code

Mark,

If you have IIS installed on your machine (most do, these days), then you
could copy your website to the localhost root folder, which on your PC is:

C:\Inetpub\wwwroot

Once that is done, click on http://localhost/ and the website you have
copied into the wwwroot folder should launch.

As Mr. Anderson pointed out in a reply to me below, this will only work with
Internet Explorer (6 and up, I think).

If your website pages include ASP, you will need to open the IIS console
(under Admin Tools) and set the permissions for the folders that contain the
ASP files.

Hope that helps!

Mark Goldin said:
Not sure how to do that.

Dave Anderson said:
In the IIS console, check the [Advanced...] web site identification
properties to ensure that the host headers are accounted for if you have
more than one web site running.

You actually asked about "localhost". Why are you not doing this?

127.0.0.1 mark

Or for that matter, why not just use "http://localhost:8080" ?
 
J

jp2code

Mark,

You want to edit the "hosts" text file, as described by Mr. Anderson
earlier:

In other words:

Click the "Run..." command under your Start button.
Next, type in "notepad.exe c:\windows\system32\drivers\etc\hosts," in the
Run dialog box.
This will open Notepad with the "hosts" file.

Make sense?
 
P

Peter Smith

Dave said:
I just tried it on my machine and got the localhost -- on IE only. And
IE seems to cache the IP in a way that requires a restart (of IE, not of
Windows) if you make the change.

Maybe

ipconfig /flushdns

would also work.
 
D

Dave Anderson

Peter Smith said:
Maybe

ipconfig /flushdns

would also work.

Maybe, but I doubt it. As I said, restarting IE is sufficient, so I surmise
that IE never looks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,786
Messages
2,569,626
Members
45,328
Latest member
66Teonna9

Latest Threads

Top