The MU forums have moved to WordPress.org

Password Protect individual Blog(s) (4 posts)

  1. cjhmdm
    Member
    Posted 14 years ago #

    Hello, I was wondering how I'd go about password protecting specific blogs created in wpmu?

    For instance, I have a blog at example.com/blog that is currently being password protected via .htaccess/.htpasswd. When I create this blog in WPMU, there's no actual directory called "blog", it's just handled via rewrites. I've tried creating the "blog" directory, but as you're probably aware, it breaks the actual blog.

    I am unable to use the built in WP member management because my biller needs to manage users via .htpasswd.

    If not possible via .htaccess, what about php? Can I add the auth things I need into say wp-config.php or whatever?

    Any ideas/help is greatly appreciated. Thanks

  2. andrea_r
    Moderator
    Posted 14 years ago #

    You can't make a blog called "blog". Not in a subfolder install.

    You *can* have a password protected blog, or at least a blog that is only visible to certain people using this plugin.

    http://wpmudevorg.wordpress.com/download/999830698_ds_private_blog.php

    (direct link to the download code there, right click & save as)

  3. cjhmdm
    Member
    Posted 14 years ago #

    I was using "blog" as an example.

    Nonetheless, I figured out how to do what I needed. It requires access to the apache (vhost) conf file, here's an example in case anyone else needs to accomplish this.

    Apache only.
    Requires direct access to your domains vhost file.
    For the below example, your base WPMU install will be at domain.com/wpmu
    Place the following below your </Directory> directives but above the </VirtualHost> directive.
    ------------------------------------
    <Location /wpmu/protected>
    AuthUserFile /path/to/.htpasswd
    AuthGroupFile /dev/null
    AuthName "Authentication Required"
    AuthType Basic

    <Limit GET POST>
    require valid-user
    </Limit>
    </Location>
    ------------------------------------

    That's it.

  4. nedlud
    Member
    Posted 14 years ago #

    Thanks for this. Perfect solution for my problem.

About this Topic