In my case, the answer of brentonstrine (and I see that matdumsa also had the same idea) was correct ... I would like to vote for their answers, but being new here, I have no "reputation", so I have to write the full answer to emphasize what I consider the real key.
Some of these answers have successfully stopped using WordPress index.php ... but in many cases the reason for this is that there is a real directory with real pages in it that you want to display directly, and
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d
the lines already take care of this, so most of these decisions are a distraction in a case like mine.
The key was brentonstrine's to understand that the error was a secondary effect caused by password protection in a directory that I tried to display directly. Inserting
ErrorDocument 401 /err.txt ErrorDocument 403 /err.txt
and creating error pages (I actually created err401.html and err403.html and made more informative error messages). I stopped the 404 response that was generated when it could not find any page for 401 authentication, and then the folder worked as expected ... showing the Apache login dialog, then the contents of the folder or failure, my page with error 401.
carlaron Oct 21 '14 at 23:02 2014-10-21 23:02
source share