job.answiz.com
  • 4
Votes
name

I find it confusing to work on my site locally when there's something like "localhost:80" in the adress bar. It would be much better to have something like "mydomainoffline.com" which then maps somehow to "localhost:80", if possible. How would I do that on the MAC?

I use the free MAMP package (mamp.info), not the commercial MAMP PRO. So I need to do that sort of thing by hand. How can I do that?

The Internet is the same way for the most part. Just like every company out there will have a different and unique phone number, every web site out of the Internet will have a specific numeric address assigned to it known as an IP address or “Internet Protocol Address”. Most people do not realize that Internet servers can only be addressed via IP addresses. However it would be impossible to remember that the IP Address for Joe’s Pizza is 201.983.756.4, so the Domain Name System was created.

Host names are the web site addresses you see every day: www.google.com, www,joespizza.com, and so on. We used these “words” like www.google.com so humans don’t need to remember the long IP address numbers when they want to visit a web site.

Now let’s use the first example of placing a traditional phone call into the context of visiting a web site using your computer’s browser to explain how web addresses work.

  • 1
Reply Report

Edit your HOSTS file (/etc/hosts) Replace localhost by the desired name

And you don't need to have :80 because it is the default HTTP port anyway

Finder->Go To-> /etc/

Then open up the hosts file with TextEdit and do what I said above

  • 1
Reply Report

I realize that the OP has a mac, and that the solutions given work for both mac and linux.

But I would also like to add that Windows has a hosts file too in C:WindowsSystem32driversetchosts, in case someone comes here through google with the same problem and uses windows :)

  • 4
Reply Report