I'm not sure doing this is a great idea.
Open /etc/hosts and add:127.0.0.1[tab][/tab]example.comNow,
only on your PC, when you visit example.com, it is redirected to your
website on your PC. It is thus very easy to work with real URL's while
the website is actually still in development. Especially useful where
you rely on real website url's in your/others scripts.
I think that your PC needs 127.0.0.1 to be "localhost".
So, you should not replace the "localhost" line with the "example.com" line.
You should better add the alias example.com after the word "localhost"
and your /etc/hosts (or %%windir\system32\drivers\etc\host for Windows users) should rather look like
127.0.0.1 localhost example.comRegards