Blog

Categories

SEARCH

About Me

Hello there, my name is Brett Popoleo and I work as a freelance web designer and web developer in Pittsburgh, Pennsylvania. Read More

What I'm Doing...

Posting tweet...

Edit your Mac HOSTS file

Posted in: Blog, Tutorials by Brett on June 16, 2008

1249498102_folder_apple_with_fileIf you like making things a little easier on yourself while you are working on your local development server this is for you!

What am I talking about you ask?

hmm….
What I am talking about is editing your Mac hosts file so that you can view your local site with this

http://myawsomesite

rather than this

http://localhost/myawsomesite

Here it is….

Launch your Mac Terminal and type
sudo su [RETURN]
Enter Root Password [RETURN]
nano /etc/hosts [RETURN]

Position yourself with your keyboard arrows
type 127.0.0.1 myawsomesite

Hit the ctrl-x keys. Terminal will ask if you want to save changes. Type a “y” for yes.
Hit [RETURN] to save the file

thats it, now type http://myawsomesite into your internet browser and it will take you to you local site.

note: If you are using a v-host configuration in apache, you will need to add myawsomesite as an alias under that host.