tags:

views:

62

answers:

2

I have a MU site related to Doctors and they will be publishing information that I cannot let outside sources and robots view.

Is there a way that when you go to the main domain url, it shows a user/pass login for WP. I would set up the user/pass in the backend. Then they would login, then be able to view the website? I can't have it load up for anyone, I need the website to be password protected to even view the website in general.

I know I can use .htaccess to have a user/pass, but it would be ideal to use the user/pass generated by WP so I don't have to mess with code when I create a user.

Any help would be greatly appreciated.

A: 

This might be what you're looking for, although I've never actually used it.

Chris Thompson
A: 

If you're into programming and customizing WordPress themes (and want to create the solution yourself) add the following code to the top of your functions.php file:

function private_blog() {
    if (!is_user_logged_in()) {
        auth_redirect();
    }   
}
add_action('template_redirect','private_blog');

If you want a plugin solution, there are plenty. Just do a search for "wordpress private" and you'll find a ton. Private Only is one that I've used successfully.

Clay Mabbitt