WordPress site available both from local or external pc
I’m using wordpress for the “first website” and I’m at my first post on this forum. Excuse me if I put a question which maybe has been already answered. I made some search but no topics really reflects the problem I want to solve.
I’ll try to explain:
I installed wordpress on a private server (a computer I have at home). The server is in a normal home network, connected to an ADSL Router.
Website is ready, but was accessed only from the server itself ’till now. So, in the “WordPress Address” and “Website Address” fields I put “http://localhost/insightphoto” (where “insightphoto” is the webroot subdirectory where I put wordpress, obviously). I used to write “http://localhost/insightphoto” in the browser to check website locally, and it worked fine.
Now that the website is ready, I tried to open it from other PCs, both inside and outside the LAN server is connected to. In both cases, I’ve found the same problem.
As a consequence of the absolute paths WordPress uses (I guessed that, but I’m almost sure about it), I can’t access website from outside if “localhost” is specified as website address in the options; this ’cause every internal link the server returns is pointing to a “localhost” resource, which is obviously unreachable from PCs different than the server.
So, I tried to solve this problem putting the external IP of my router (I still don’t have a domain name) in the options instead of “localhost”. This could solve the previous problem, but creates another one. Site becomes available to computers outside the LAN, but starts to be unreachable from PCs inside the LAN, even the server itself!
This ’cause if I try to use the external, public IP address from inside the LAN, it just doesnt’ work (as expected…). So, I can’t access the control panel from the server anymore.
I already tried to put a line in the “hosts” file, to redirect calls to public ip —-> 127.0.0.1. But it seems that hosts file works only with domain names and not with IPs.
It’s pretty annoying to be unable to work on the website from the server itself.
Is there a way to solve this problem?
I specify that all the conclusions I wrote are only my guesses, so everything could be wrong! I’m not an expert in website and network management. 🙂
Please forgive me for mistakes I could have made in english, I’m italian and the subject is quite complicate!
Thank you all!
- The topic ‘WordPress site available both from local or external pc’ is closed to new replies.