Danger Error Yoga Pants mod rewrite .htaccess

When using WordPress with candied URLs you are using .htaccess files to do URL rewrites to make the more human and google friendly URL version. It turns out that when you try to access a subdirectory that is password protected it returns the web server responds with a “401 Unauthorized” header and an optional error document, then prompts the user for Authentication details. When rewrite rules are in place, the default error document path used by the web server is evaluated using the rewrite rules. If an actual error document does not exist in the default error document path, this is passed on to the CMS for parsing. In this case, since the file is not found, the CMS gets confused and displays a 404 error rather than a 401, causing the web server to not even prompt for authentication.

The fix is to add the following line to your .htaccess file:

     ErrorDocument 401 default

When the code is matched it just does nothing to the URL and exits. 

Research Links

 

Categories: Computing

Fudgy McFarlen

Woo hoo.

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

Computing

Protected: How to get root access on AP-120 at the boot loader prompt

There is no excerpt because this is a protected post.

Computing

U-Boot Commands

base    – print or set address offset bootm   – boot application image from memory bootp   – boot image via network using BootP/TFTP protocol cmp     – memory compare cp      – memory copy Read more…

Computing

Router Console Port Connection using USB to Serial TTL Adapter

The cable is easiest way ever to connect to your microcontroller/Raspberry Pi/WiFi router serial console port. Inside the big USB plug is a USB<->Serial conversion chip and at the end of the 36" cable are Read more…