Accessing local Wordpress site within the network using WAMP?

一个人想着一个人 提交于 2019-12-04 19:31:35

Allow 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.

# onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from 192.168

Then in the WP General settings, I changed the Wordpress Address and Site Address to the site's actual IP. You can get this site's IP4 address via ipconfig 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 (the www folder) with this:

Order Deny,Allow
Deny from all
Allow from 127.0.0.1

Then add this above whatever is in WP's default .htaccess

Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from 192.168

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.local

192.168.2.54 wordpress.local

Couple of good tutorials on getting these setup:

  1. View MAMP Virtual Hosts On Your iPad and iPhone Over The Local Network - BenjaminRojas.net http://goo.gl/6hM4Aa
  2. How to access MAMP sites across a network - CodeBoxers http://goo.gl/qCXMQK (scroll down to the xip.io portion)

"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)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!