Emrys Posted April 12, 2013 Share Posted April 12, 2013 Hey Guys, I have a situation that has been bugging me for a long time, my website is currently hosted on a virtual machine on my home PC. I have my domain which redirects to a dynamic dns which points port 80 to port 8080 on my router, that port fowards to the virtual machine as it's network adapter allows me to put it on my local network as a PC with it's own IP address. When anyone connects to the website the URL stays the same so they still think they are visiting the same URL and not the redirected one. Let's be honest that is how a website should work. Connecting to the website and everything else is fine, however if you change from the page you see initially, the home page, the URL will not change at all. Any link salso redirect to the original domain and any following directories, yet the URL will stay the same no matter how you connect to the website. If you connect to a different page other than the home page, say /contact.html then no matter where you go on the site the URL stays as /contact.html. I have a feeling this is because I host it at home without DNS on my network pointing to places and I've not figured out a way to do that instead, but I also cannot understand why it wouldn't amend the URL? Can anyone shed some light on this for me? Thanks guys! Emrys. Quote Link to comment https://forums.phpfreaks.com/topic/276869-hosting-a-web-site-at-home/ Share on other sites More sharing options...
requinix Posted April 12, 2013 Share Posted April 12, 2013 It's a result of the service you're using. Because you have it changing ports they have to use framesets or iframes to make the website work. Otherwise people would have to go to yourdomain.com:8080. The problem with doing it that way is what you've discovered: the URL stays the same. 1. Configure your router to forward port 80 traffic to your VM's port 8080. 2. Configure your dynamic DNS to just do regular DNS (no port stuff) with your router. 3. ??? 4. Profit Quote Link to comment https://forums.phpfreaks.com/topic/276869-hosting-a-web-site-at-home/#findComment-1424405 Share on other sites More sharing options...
Emrys Posted April 12, 2013 Author Share Posted April 12, 2013 Hi requinix, Thanks for replying, what you're saying is basically I need to use my dynamic dns or look into hosting? Quote Link to comment https://forums.phpfreaks.com/topic/276869-hosting-a-web-site-at-home/#findComment-1424449 Share on other sites More sharing options...
requinix Posted April 12, 2013 Share Posted April 12, 2013 Yes. The dynamic DNS service you have now should be perfectly fine - just don't use the "domain masking" feature, or whatever they may brand it as, that you're using now. Once you set up the router to accept port 80 (but still forward to 8080) the literal dynamic DNS part of it is all you really need. Quote Link to comment https://forums.phpfreaks.com/topic/276869-hosting-a-web-site-at-home/#findComment-1424459 Share on other sites More sharing options...
Emrys Posted April 13, 2013 Author Share Posted April 13, 2013 Well once I ascertain what is actually wrong on the viewing side I'll hopefully get it working, but the way it works is the domain name is hosted on namesco (names.co.uk) and in the options I can forward the domain to another URL, which I use to forward to my dynamic dns which forwards to my VM. Whatever happens viewing the source shows it still portrays the page as a frame, surely this means that navigating elsewhere such as using a hyperlink will continue to maintain the URL as the same. I can of course change the DNS settings for the website to point to my dynamic dns but surely I need some sort of DNS on my network to point the domain name in the right direction? Quote Link to comment https://forums.phpfreaks.com/topic/276869-hosting-a-web-site-at-home/#findComment-1424586 Share on other sites More sharing options...
requinix Posted April 13, 2013 Share Posted April 13, 2013 I'm 95% sure it's the frameset/iframe thing I mentioned. When you do a View Source of your website, make sure you're doing it from the browser menu and not a context menu. You'll see a or . You don't need your own personal DNS setup covering your router and the web server (unless you want one for your entire lan, but that's a different problem). The way you configure the router takes care of that: it receives traffic for its port 80, it forwards that traffic to port 8080 of some specific machine inside your network. Think of it like hardcoded DNS. Quote Link to comment https://forums.phpfreaks.com/topic/276869-hosting-a-web-site-at-home/#findComment-1424613 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.