Anyone out there who runs a WordPress site and an osCommerce store will most likely have come across this problem. Let’s say WP is your site’s CMS under http://mydomain.com/ and your osCommerce installation is under http://mydomain.com/catalog/. If you try to access /catalog/admin/ in your browser, you might be greeted by a WordPress 404 page, blocking you from accessing the administrator page. The temporary fix for this solution would be to simply remove/rename the .htaccess file under /catalog/admin/ and login to the administrator section. This is highly annoying and poses a security risk: what if you forget to put the .htaccess file back?
After looking around the web for an answer, I found this solution. In your /catalog/admin/.htaccess file, put the following:
ErrorDocument 401 /[path_to_file]/myerror.html
ErrorDocument 403 /[path_to_file]/myerror.html
Once inserted, create a “myerror.html” file in a directory of your choice (let’s say in the root of http://mydomain.com/) and customize the page with a 401/403 message if you wish. That’s all there is to it!
I found this solution from this page. Their explanation is, and I quote: “HTTP Basic-Auth first sends 401 Unauthorized
to request a password from the browser. The webserver tries to serve the corresponding, specified Errordocument. However when the ErrorDocument directive of your webserver is set wrongly, i.e. points to a non-existent file, [WordPress] ends up handling the page-request.”