Forum Moderators: phranque

Message Too Old, No Replies

localhost vs actual link

developmental site vs actual site

         

jscjso

2:03 pm on Oct 31, 2009 (gmt 0)

10+ Year Member



I have a machine(xp) running the actual site. All the links in the site are pointing to, for example, www.abcxyz.com/.....

I have another machine(vista) running an identical site but is for further development and test run. For this copy, I have all the pointers pointing to "localhost" instead of www.abcxyz.com.

This works, but I think is a dumb way.

The problem is everytime I move the developmental copy to the actual site. I have to change all the "localhost" to "www.abcxyz.com", there are too many lines to change.
Is there a way to skip this trouble? Like setting up a fake abcxyz.com in my vista machine to point back to localhost......Or do not use localhost and use something else.......

jdMorgan

2:38 pm on Oct 31, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Leave your links alone, and simply go to the 'hosts' file on your local machine and add an entry pointing your "www.abcxyz.com" hostname to "127.0.0.1" -- localhost.

Your operating system will check the hosts file before issuing a 'real' DNS lookup.

The 'hosts' file handling is fairly "dumb" -- If you want both "www.abcxyz.com" and "abcxyz.com" to resolve to your local machine, you'll need two entries, one for each.

The name of this file is always 'hosts', no matter what OS you are on. In Windows XP, it's in /windows/system32/drivers/etc/hosts
Edit it with a plain-text editor only.

If you later wish to access the 'real' www.abcxyz.com from that machine, just delete or comment-out the hosts file entry.

Jim

jscjso

2:48 pm on Oct 31, 2009 (gmt 0)

10+ Year Member



Jim,

Wow, what an eye openner. I will try.

Thanks,
Jason

jscjso

9:05 pm on Oct 31, 2009 (gmt 0)

10+ Year Member



Jim,

It works. Thanks.
This helps me to save a lot of times.

Jason