wordpressdnsrouterlan

Making a WordPress site accesible from inside LAN and outside it


I configured WordPress on a PC inside my LAN. So I can access it from the same computer with localhost/WordPress or another pc on the LAN with IP/WordPress.

I configured the router so port 80 is redirected to the server IP, but if a page is loaded from outside my LAN, it fails to load CSS and JS as the route is localhost on WordPress config. If I change it to my freedns url, let's say: myamazingurl.mooo.com, it is accessible from outside my LAN and it loads CSS and JS.

Now I can't access my website from inside the LAN. Is there any workaround or fix for that?

I read about dnsmasq but I didn't succeed.


Solution

  • One option I found is to edit /etc/hosts file and redirect the freedns url to my localhost. So it's working now but I don't know if it's the right way of doing this...