Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to let others access the website that I have made. A point of sale system to be exact. Is it really normal for people outside the network to see broken links? I'm using apache as a server. Installed through wampserver. How do I fix this problem? Basically everything is working when I'm just the one who is testing the site. Please comment if you need more details. Thanks

update They can access my localhost using my ip address. They can see the site, but when they click to further links they report an object not found error. I don't know why since I don't see anything like that when I'm the one who is accessing it from localhost itself. http://localhost/pos

share|improve this question
    
It's not possible to connect to the localhost or 127.0.0.1 address of another computer, you use its IP address. So I'm not sure what your issue is, could you please clarify. I'm reading this as either "they can't connect to the site at all" or, since you mention broken links, "they can reach the site's homepage, but cannot follow links on the page"? –  DMA57361 Jan 20 '11 at 13:32
    
RE your update: you cannot use http://localhost/ on the site because if they click a localhost link they will be trying to connect to thier own computer. –  DMA57361 Jan 20 '11 at 13:38
add comment

1 Answer

up vote 3 down vote accepted

localhost is a "magic" hostname that always refers to "this computer".

Specifically, it's the standard hostname given to the loopback network interface.


If your site includes links that point to localhost, then a user of the site will end up trying to connect to thier own computer.

All URLs should be relative if possible (eg, no hostname. So /images/logo.png and not http://www.example.com/images/logo.png). This eliminates the problem, because without a hostname it will use whichever one was already used.

But, if you have to make URLs absolute, then the hostname cannot be localhost. It should be either your domain name or external IP address.

share|improve this answer
    
thanks, that enlightened me. I think I'll just have to change all the links in my site then. Because I'm using absolute urls on my site. –  Ieyasu Sawada Jan 20 '11 at 14:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.