Secondary WordPress admin .htaccess password prompting during site use

Avatar
  • Answered
After setting up the secondary password, category links on the portfolio page bring up the secondary password prompt when clicking. I didn't notice at first because I was always logged in to wordpress, but all other viewing the site are unable to click on a portfolio category:
"Show All Automotive Branding Clothing Events Identity Illustration Outdoor Photography Project Vehicles Video Web"
http://6thgearadvertising.com/wordpress/portfolio
Not sure why this is happening. I have tried changing permalinks with no luck. Can this be corrected while still utilizing the secondary password?
thanks,
Brian
Avatar
JacobIMH
Hey Brian, thanks for the question and sorry for the issues! I'll have to update my guide on how to use a secondary WordPress admin .htaccess password, so thanks for letting us know about these issues. In that article another customer had similar issues with the WP-PostViews plugin for WordPress needing to request /wp-admin/admin-ajax.php, but because the password protection was setup on the /wp-admin directory, the plugin would cause the prompt when trying to hit that script. I've gone ahead and fixed this problem for you by placing the following code in your /wp-admin/.htaccess file at the top above the .htaccess password protection:
# Allow plugin access to admin-ajax.php around password protection
<Files admin-ajax.php>
Order allow,deny
Allow from all
Satisfy any
</Files>
This will allow requests for /wp-admin/admin-ajax.php to still happen from any plugins, while still leaving the rest of the files in the directory password protected. I've tested it out on your Portfolio page, and everything seems to be working normal now without a password prompt. Really cool looking stuff you've got up there too! Anyways, thanks again for letting us know we need to update our documentation. Let us know if you encounter any further issues at all. - Jacob