Add fancy alias for your localhost or 127.0.0.1

Recommended VPS for your FreeBSD or Linux Server + Custom Iso Allowed (Free $20 credit for limited time, grab it now)

A few student in my class ask me how to change default address for testing php script from http://localhost or http://127.0.0.1 into some real name like derick.com or google.com while they offline at home and no internet connection availabe at home .

After googling for /etc/hosts equivalent finaly I got the answer, still related name :

HOSTS

Just doing this :

Find file named : HOSTS

in

C:WINDOWSsystem32driversetcjust put name you like :

I type alamster.com for 127.0.0.1

here my HOST file looks like

127.0.0.1       localhost

127.0.0.1       alamster.com

save the file

restart my computer and next time after my computer up I can use http://alamster.com as alternative of http://localhost or http://127.0.0.1