Base de Conhecimento

WordPress preventing you from password protecting a directory?

You wish to password protect a subdirectory with a .htpassword and .htaccess, but you have WordPress installed in the root with perma-links enabled. The solution is simple.

  1. Create a new file in the subdirectory (public_html/path/to/) and name itonerror.html
  2. Edit the root .htaccess where the modrewrite rules are for wordpress. Add the following line to the very top of the file and save.
    ErrorDocument 401 /path/to/onerror.html

Now it's fixed.

  • 30 Os usuários acharam isso útil
Esta resposta foi útil?