Re: Buddypress “Under Construction” for users/vistors ???
How To Set Up A WordPress “Under Construction” Environment
The following technique works with WordPress installed on your production server and shows everyone a “Under Construction/Under Maintenance” page while you and only you can see the site as if it were live.
• Open up the root folder of your WordPress installation and locate the index.php file. Rename this file to index_wp.php. Don’t worry, we’ll be loading this file later.
Create a new index.php file
• Fire up your favorite code editor and create a new file called index.php and save it on the root folder of your WordPress installation.
• Paste the following code, besure and save the file, now upload the new index.php to your server.
Click Image to copy code text.
I still can’t figure out how to post code, tried "code tags", "pre tags", "text area tag in form", would appreciate some help on this that works.
Another place you can copy the code.
Open your site
If you have correctly performed the previous steps you should have a WordPress installation with a custom index.php file and a index_wp.php file, both on your root installation folder. Open up your home URL and you should see your “Under Construction” page. Whoo Hoo! now everyone is seeing this page. But now we need to continue development or perhaps show our clients the current progress on their site. Head on to your browser’s address bar and type this after your home URL.
A fully functioning WordPress installation visible only to you during the complete length of your session. No redirects, no rerouting, no separate development and production folders. The code starts the session engine and looks for two variables sent as GET. The first variable is ‘uc’ (short for Under Construction). If this variable is set with any value then the var ‘pwd’ is checked to see if it matches the hard coded password. If these conditions are met a session variable is set to include the index_wp.php during the complete length of that session. If the conditions don’t match then the current session is forwarded to the “Under Construction/Under Maintenace” page and the WordPress installation never gets loaded.
• Set your own password
On line 06 in the new index.php change "123456" to set a your own password. i.e. "00cz942ab".
Besure to upload and replace the initial "under construction" index.php, with your new password version.
• To end the development session type: /?stop=true
The development session will be closed and you’ll be back on the “Under Construction” page.
• Redeploy or Open your website for users
simply rename the new index.php file to index_uc.php and then rename the index_wp.php file to index.php. If you ever need to set your website in a “Under Construction/Under Maintenace” state, simply rename the files and your done!
Hopefully you find this Under Construction hack useful, it was created by: Juan Camilo Estela