Hi,
I hope someone can help with this because I'm going around in circles and I'm thinking I'll probably just have to get a separate hosting account for an add-on domain that requires password protection.
I've used the following rules to redirect non-www access to the www version of my add-on domain:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.my-addon-domain.com$ [NC]
RewriteRule ^(.*)$ http://www.my-addon-domain.com/$1 [L,R=301]
(I've used the same thing in my main domain, with the domain name changed of course.)
In that add-on domain I have a "private" directory where I use the .htaccess file for password protection. The problem I'm having is that when someone accesses the non-www version including the private directory in the url, for example: http://my-addon-domain.com/private/
they get this:
Not Found
The requested URL /401.shtml was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
If they access that url using the www version, there's no problem.
Is anyone able to help?
Thanks for any suggestions.