You might be able to get a piece of your LAN software to map/forward the global IP to the RaPi’s LAN server. Can the router/modem be configured to forward the global IP when it is use on the LAN side ?
Now for a solution that will work:
– Configure the DHCP server in your router/modem to permanently assign a local IP to the RaPi, say “192.168.1.31”
– buy a domain name, say “myuniquename.com”
– set the domain name to resolve to your global IP
– configure the RaPi to use VirtualHost technique, details here:
http://httpd.apache.org/docs/current/vhosts/name-based.html
This will entail add VirtualHost directives in /etc/apache2/sites-enabled/001-local
Something like:
<VirtualHost *:80>
DocumentRoot /var/www
ServerName myuniquename.com
ServerAlias www.myuniquename.com
</VirtualHost>
– do the “Moving WordPress” procedure and reconfigure the RaPi to use the domain name in site address and WordPress address.
The website is now accessible from the world using the domain name, now for all the PCs on the LAN.
– on each PC on the LAN that will access the RaPi site, add these line to the “hosts” file:
192.168.1.31 myuniquename.com
192.168.1.31 www.myuniquename.com
On the RaPi this would be:
127.0.0.1 myuniquename.com
127.0.0.1 www.myuniquename.com
Details on the hosts file for various flavors of Windows/Linux/Mac at:
https://en.wikipedia.org/wiki/Hosts_(file)
it works perfect thank you so much
Would you please describe what you did ? This way this support thread becomes more useful to the wider community.
Also if you think it is appropriate would you mark this thread as closed.
i bought domain. i forwarded it to my static ip. than i added below settings in rpi
<VirtualHost *:80>
DocumentRoot /var/www
ServerName myuniquename.com
ServerAlias www.myuniquename.com
</VirtualHost>
i changed wordpress site&wordpress adress url to my domain. than i configured hosts file on my desktop.
192.168.1.31 myuniquename.com
192.168.1.31 www.myuniquename.com