Is there a program that would allow me to access my locally hosted websites like my remote ones?

1

for example I debug my local website this way

http://localhost/example.com/

Is there a program that would make a more convenient alias for it like for example

http://example.com

forcing my browser to use my local files and not the ones online?

Mohammad

Posted 2010-05-10T21:42:35.977

Reputation: 375

1Think about local hosts entries. – Ice – 2010-05-10T21:46:34.000

Answers

6

I find 'localhost' easier to type, fewer keystrokes! It gives you a chance to imagine life before TLDs!

To accomplish what you're asking, you can add a line to your Hosts file like:

127.0.0.1       example.com 

This would skip DNS lookup for example.com and go straight to your local IP. For the location of the Hosts file on your system, check out the corresponding Wikipedia article.

Neil

Posted 2010-05-10T21:42:35.977

Reputation: 415

1Not to be too picky, but if he is running multiple local sites this would require some apache configuration, too. – Benjamin Bannier – 2010-05-10T22:38:08.557

I am actually, how would one do that? – Mohammad – 2010-05-11T10:43:08.907

i just found this answer http://superuser.com/questions/81707/how-to-create-a-fake-hostname-in-windows

– Mohammad – 2010-05-11T10:47:59.470