Return to Snippet

Revision: 52200
at December 14, 2011 03:24 by adambundy


Updated Code
<?php if (!is_user_logged_in()) { wp_redirect('http://mydomain.com/coming-soon.html', 302); } ?>

Revision: 52199
at October 15, 2011 14:05 by adambundy


Initial Code
PLACE AT TOP OF HEADER.PHP:

<?php if (!is_user_logged_in()) { wp_redirect('http://mydomain.com/coming-soon.html', 302); } ?>

Initial URL

                                

Initial Description
Place at the top of your header.php to redirect visitors who are not logged-in to the Wordpress admin. I use this to redirect to a simple HTML 'coming soon' page while sites are in development.

Initial Title
Wordpress redirect non-logged-in visitors

Initial Tags
php, redirect, wordpress

Initial Language
PHP