Forum Moderators: open

Message Too Old, No Replies

Host file syntax

Looking to use the host file for a redirect.

         

mack

12:39 am on Aug 23, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Hi all.

I host my websites on my home network. As a result if I type my website url into the address bar I get the router admin page as opposed to my actual website. In order for me to view my site I need to use it's corrosponding LAN ip address.

What I want to do is alter my host file so that if I type in [example.com...] it will go to [192.16x.x.x...]

My servers are Linux but my computer is windows. I would like to be able to use domain names instead of ip's on the windows machine.

Also is it possible to use wildcards to make example.com/anything point to 192.16x.x.x/anything?

Thanks in advance.

Mack.

plumsauce

3:24 am on Aug 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




insert a line:

192.168.x.y www.example.com

where x.y complete the address that your web server is listening on on the internal facing network.

mack

9:22 am on Aug 23, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Thanks.. that's the approach I had tried, it appears to work for every page except the index page. It's quite wierd. If I go to the full ip of the router it shows me my usual admin, the same used to happen if i went to my url, when I edit the host file I how see the same page but with broken images etc.

Mack.

mack

9:24 am on Aug 23, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Hi again.

It was a caching issue.

Thanks again.

Mack.