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 permalinks enabled. The solution is simple.

  1. Create a new file in the subdirectory (public_html/path/to/) and name it onerror.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.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Uploading Image to Media in WordPress

So, to upload images or media files in your GoMedia website, simply visit your admin area and...