Mobile app version of vmapp.org
Login or Join
Phylliss660

: Redirect subdomain to local PC I have a home web server which is constantly running. Is it possible to create a subdomain which would redirect traffic to another local PC? For example, I have

@Phylliss660

Posted in: #Domains #Localhost #Subdomain #WebHosting

I have a home web server which is constantly running. Is it possible to create a subdomain which would redirect traffic to another local PC?

For example, I have one Server and one notebook (with web server installed for developing).
Now I can access to notebook only from local network with IP. Server is also hosting domain example.com. Now I would like to visit "laptop.example.com", which would be my laptop.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Phylliss660

1 Comments

Sorted by latest first Latest Oldest Best

 

@Ravi8258870

If you own 'example.com' you can create a subdomain A-record to point to its local IP (192.168.1.X or 10.0.X.X) and then access it that way, or you can make up an 'example.com' you can edit the (PC?)'s hosts file (C:Windowssystem32driversetchosts) and create a new entry at the bottom like so:

192.168.1.X laptop.example.com


And any time you access laptop.example.com on that computer, it will route to the laptop.
You need to make sure also that your laptop allows inbound connections to it, so check out any firewall entries that may need to be modified.

With this, nothing will be accessible from outside your local network. Comment if you have questions.

If you are trying to get your laptop's server to run publicly too, you'd need to either have it run on a separate port publicly, or you use what's called a reverse proxy to proxy the content via your other server. This can be done in Apache very simply:

<VirtualHost *:80>
ServerName laptop.example.com #publicly set in DNS
ProxyRequests off
ProxyPass / 192.168.1.X:80/ #local IP of laptop
ProxyPassReverse / 192.168.1.X:80/ #same as above
</VirtualHost>


What webserver software are you running?

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme