WordPress.org

Ready to get started?Download WordPress

Forums

Basic Password to access blog (2 posts)

  1. samhankin
    Member
    Posted 1 year ago #

    Hi,

    Does anyone know of a plugin that will allow me to have one simple password to block access to the whole of my site.

    For example if someone went to blog.website.com they would be presented with a password box only. They would then have to type in the password to get into the blog.

    I only need one password to allow everyone access.

    Thanks

  2. threestyler
    Member
    Posted 1 year ago #

    Your host probably provides a quick way to do this via your control panel.

    Otherwise create a file called: .htpasswd

    Inside add your username and password:
    username:password

    Save the file ABOVE public_html directory so it is not publicly accessible.

    ie if your site is located:
    /home/username/public_html/websitename
    Put the .htpasswd file:
    /home/username/

    Then in your .htaccess file (located in the root of the directory you want to protect) add:

    Authtype Basic
    AuthName "Protected directory"
    AuthUserFile /path/to/your/.htpasswd
    Require user username

    Changing username for either your username in the .htpasswd file or valid-user if you plan to have several user accounts.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.