Jen-a-Bean Posted November 8, 2009 Share Posted November 8, 2009 I can access my desktop server from my laptop using http://192.168.1.70:8080, but I'd like to be able to just type in http://computerName instead. As I understand I have to edit the hosts file on the computer (c:\system32\drivers\ect\hosts). This is what I've added: 192.168.1.70:8080 computerName It doesn't seem to work? Also if I try the same process on a system running Vista I can't even save modifications to the hosts file. I even tried saving the file to the desktop, and then copying to to the proper folder. Since it saves as a TXT file it doesn't overwrite the file in the proper directory. Any ideas? Link to comment https://forums.phpfreaks.com/topic/180803-solved-specifying-a-host-location/ Share on other sites More sharing options...
rajivgonsalves Posted November 9, 2009 Share Posted November 9, 2009 That should work first of all your host file has to be in the windows directory you will have to run notepad as adminstrator to edit and save the file Link to comment https://forums.phpfreaks.com/topic/180803-solved-specifying-a-host-location/#findComment-953874 Share on other sites More sharing options...
trq Posted November 9, 2009 Share Posted November 9, 2009 The hosts file maps hostname's to ip addresses, you cannot place a port within it. 192.168.1.70 computerName then.... http://computerName:8080 should work. Link to comment https://forums.phpfreaks.com/topic/180803-solved-specifying-a-host-location/#findComment-953909 Share on other sites More sharing options...
Jen-a-Bean Posted November 9, 2009 Author Share Posted November 9, 2009 I believe I have it working now! When I ran Notepad as an administrator it allowed me to save the file to the location I needed. I'll never get used to having to tell the computer I'm running a program as an admin after being logged into an admin account. The location of the file should actually be c:\windows\system32... as Rajiv noted. I neglected the windows part when typing the path in my original message. Once I removed the port number from the hosts file it was able to redirect properly. Thanks again for the help all! Link to comment https://forums.phpfreaks.com/topic/180803-solved-specifying-a-host-location/#findComment-953966 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.