是的,你可以通过使用.htaccess过滤访问。
RewriteEngine On
RewriteBase/
# Your IP Address
RewriteCond %{REMOTE_ADDR} !^192\.168\.0\.1$
# More IPs
#RewriteCond %{REMOTE_ADDR} !^255\.255\.255\.255$
RewriteCond %{REQUEST_URI} !^/soon.html$
# If you need to also give access to some specific folder (for example images)
# you can use the following instruction
#RewriteCond %{REQUEST_URI} !^/images/.*$
# This line says: redirect to soon.html.
# This is a redirect (sent back to the browser), so the full URL is required.
# We're using 302 because sooner or later you'll open the website for everyone.
RewriteRule ^(.*)$ http://www.example.com/soon.html [R=302,L]
只是把这个在你的.htaccess(所有其他指令之前,你可能在那里),每个人都认为不具有IP将被重定向到soon.html。
这样你就可以继续开发与最终网站所在的路径相同的路径。
备注: 这将过滤所有其他IP,包括来自第三方实体的pingbacks。如果您使用PayPal IPN或需要与您的网站通信的任何其他网关,则必须手动将该IP添加到.htaccess中(如代码本身所述)。
希望这会帮助你。
http://codex.wordpress.org/Moving_WordPress应该回答你的大部分问题 –
哇,谢谢!很棒的链接! – Marshal