Jump to content

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/276869-hosting-a-web-site-at-home/
Share on other sites

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

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.

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?

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
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.