Accessing a site via localhost instead of IP

How do i set it up so my php files in my sites folder can be viewed with just the command

localhost/

instead of the default

http://10.0.1.35/~john/

the bottom one works fine but where do i need to change it so in my browser i can just enter localhost

Answers


check your /etc/hosts; it should have an entry 127.0.0.1 localhost. then you can just use http://localhost/. you can't just use localhost/ because that is not necessarily http and your browser may interpret that as a search or something.


Need Your Help

View source in iOS Simulator?

ios ios-simulator

Does anybody know of a tool where I can inspect the source code of a site in Apple's iOS Simulator? Something like Firebug or the Chrome Developer Tools for this would be great, and I haven't found

UnicodeEncodeError: 'ascii' codec can't encode character u'\u2026'

python python-2.7 unicode beautifulsoup urllib2

I'm learning about urllib2 and Beautiful Soup and on first tests am getting errors like: