Allright this driving me nuts! I have spent couple of hours trying to find a solution of how to access my Wordpress site from outside my network, when no easy solution was found I'm OK with just being able to accessing it from another device within my network. It turned out to be a tricky part as well. I just don't know how to configure this.
I run virtual hosts using WAMP likeso:
In httpd-vhosts.conf:
<VirtualHost *:80>
DocumentRoot "I:\web_dev\wordpress"
ServerAlias wordpress.local
ServerName wordpress.local
<Directory "I:\web_dev\wordpress">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
Require local
</Directory>
</VirtualHost>
My httpd.conf file is set to port 80:
ServerName localhost:80
Hostsfile:
127.0.0.1 wordpress.local
If I now want to access this from another computer or my mobile that are in my network, how do I achieve this?
You'll need to change your Listen directive to listen to the network IP or 0.0.0.0 rather than localhost if that is not yet done. Then on the other computer edit the hosts (usually
C:\windows\system32\drivers\etc\hosts
or/etc/hosts
) file to include the IP of the webserver computer mapped to wordpress.localAllow local traffic in httpd.conf, then use your actual IP as the WP URL.
In WAMP's httpd.conf file, I added the
Allow from 192.168
line.Then in the WP General settings, I changed the
Wordpress Address
andSite Address
to the site's actual IP. You can get this site's IP4 address viaipconfig
in the command console.Then you're done.
If you don't want people on your local network snooping around the rest of your WAMP setup, create a new
.htaccess
file in the servers root (thewww
folder) with this:Then add this above whatever is in WP's default
.htaccess
Couple of good tutorials on getting these setup:
"The solution is to create a local proxy server on the machine that has MAMP installed, and then configure the client to use that proxy to browse the web. The client configuration only takes a few seconds, and is easy to disable once you’re done." - Dalton Rooney (from the first link)