Help with VirtualHosts

in Genius Bar edited January 2014
I'm trying to host a family website on my OSX machine, but I'm having trouble getting it to act like a "normal" website in terms of what appears on your browser's URL bar. I'm hoping someone can tell me what I'm missing in the configuration.

I registered a domain name, call it The machine hosting the website has a dynamic IP which rarely changes, but it resolves to a URL including the router info (something like I set up domain forwarding to forward to It works great. Anyone who goes to "" goes straight to the web page. BUT, once they get there, all the addresses and links appear as "" rather than "". I'd like it to act like a "real" website, where all the addresses are presented as relative to the domain name, instead of the domain name acting as a mere forwarding address.

I tried turning on NameVirtualHosts in httpd.conf, and adding an entry for my domain name, but it didn't work. What I added looked like:




DocumentRoot /Library/WebServer/Documents

ServerName localhost


<VirtualHost *:80>


DocumentRoot /Users/myuser/Sites


(The localhost bits are so I could still type "localhost/~someuser" into the machine's web browser and pull up the local sites.) Not only does this not work, but it screws up how the machine responds to other HTTP requests. For example, if try to visit "" it shunts the document request to "". If I add a trailing "/" to the address, however, it still works normally.

What am I doing wrong? All the Googling I've done suggests this should be it. I shouldn't have to worry about NetInfo (I think) unless I want to add new localhost aliases, which I don't think I want to do. Any suggestions?


  • Reply 1 of 3
    toweltowel Posts: 1,479member
    Eh, nevermind. Fundamental misunderstanding of how the web works on my part. I would need to register the domain name with my ISP's DNS servers; setting up domain forwarding doesn't cut it. The lesson is that if I want a "real" website, I need a "real" hosting service.
  • Reply 2 of 3
    If you would use DynDNS's dynamic DNS service (as opposed to the forwarding service) then this would work out for you. Your ISP does not have to be the ones doing DNS work for you.
  • Reply 3 of 3
    ast3r3xast3r3x Posts: 5,012member
    I did the same thing you did, only for

    I use and it works great. It's free up to 5 domains I think, and they don't limit subdomains. They offer some other features too.
Sign In or Register to comment.