Forums

Password protecting /wp-admin/ (7 posts)

  1. TimothyA
    Member
    Posted 4 months ago #

    I have been trying to password protect the wp-admin folder using .htaccess, but instead of asking for the password I get "Error 404 - Not Found". Any ideas?

  2. Fips
    Member
    Posted 4 months ago #

    What does your .htaccess file say?

  3. TimothyA
    Member
    Posted 4 months ago #

    AuthUserFile /home/xxx/public_html/wp-admin/.htpasswd
    AuthGroupFile /home/xxx/public_html/wp-admin/
    AuthType Basic
    AuthName EnterPassword

    require user xxx

  4. TimothyA
    Member
    Posted 4 months ago #

    BTW... that is the one I wrote, but I even used my hosting company's tools to password protect, and I get the Error 404 with their .htaccess as well.

  5. 4seoblogs
    Member
    Posted 4 months ago #

    The same problem.
    I have installed .htaccess into the folder wp-admin
    When i'm trying to get to http://myblog.com/wp-admin - WP redirects me to 404 page.

    The server is running CentOS + DirectAdmin. On all servers running DirectAdmin i got THE SAME!! problem. On other servers without DirectAdmin all is OK.
    I tried to rebuild Apache (2.0 \ 2.2) all the same.
    Please Help, i really need the directory wp-admin password protected.

  6. 4seoblogs
    Member
    Posted 4 months ago #

    problem solved
    wp-admin .htaccess

    ErrorDocument 401 default
    
    AuthType Basic
    AuthName "Restricted Area"
    AuthUserFile /home/admin/domains/*****.info/public_html/wp-admin/.htpasswd
    require valid-user

    main .htaccess in domain root

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
  7. Fips
    Member
    Posted 4 months ago #

    For that little extra security it's probably worth keeping your .htpasswd file outside of the web accessible area. And like 4seoblogs, you shouldn't need the reference to AuthGroupFile in your .htaccess file if you aren't intending to use one, TimothyA.

Reply

You must log in to post.

About this Topic