Knowledgebase

Portal Home > Knowledgebase > Technical > Wordpress preventing you from password protecting a directory?


Wordpress preventing you from password protecting a directory?




Question:
Wordpress preventing you from password protecting a directory?

 
Answer:

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.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read

Powered by WHMCompleteSolution