2

I'm not very knowledgeable about server scripting, however I've only just installed SSL certificate for the domain.

The main website (hosted by GoDaddy) is now working fine on SSL/TLS and I've modified the .htaccess file for the main site to GoDaddy's specification. All seems well.

I have a sub-directory on the website (linked from a menu item) which has a password challenge before allowing users to process the index.htm in that directory. The .htaccess file in the sub-directory contains the following script:-

AuthType Basic
AuthName "Area Restricted to Authorised Users Only"
AuthUserFile /home/{path to subdirectory}/.htpasswd
require valid-user
ErrorDocument 401 /errorfiles/401.html
ErrorDocument 403 /errorfiles/403.html
ErrorDocument 404 /errorfiles/404.html
ErrorDocument 500 /errorfiles/500.html

I now get error 401 (unauthorised) when attempting to link to the sub-directory. What am I doing wrong please? (Note: if I remove the .htaccess file then I can get straight in to the index.htm file with no challenge but still on SSL)

6
  • Are you saying you do not see a password challenge? Make sure you've cleared your browser cache / try a different browser. This isn't something that should have necessarily required updating when moving to HTTPS. The only thing you can really do is make sure that the path to the password file is correct (although if this is incorrect then you would expect a 500 error, not a 401).
    – MrWhite
    Mar 7, 2019 at 17:00
  • "I've modified the .htaccess file for the main site to GoDaddy's specification." - What "modifications" did you need to make?
    – MrWhite
    Mar 7, 2019 at 17:01
  • No, I don't see a password challenge - it's error 401 immediately.
    – tonyb
    Mar 8, 2019 at 10:53
  • No, there is no password challenge. The main site .htaccess file has the following contents. RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteCond %{HTTP_HOST} ^(www\.)?roystonrotary\.com RewriteRule ^(.*)$ https://www.roystonrotary.com/$1 [R,L]
    – tonyb
    Mar 8, 2019 at 10:55
  • 1
    Thank you for your help, the problem is cured now. It was use of the explicit http// launch command in the menu item - once I changed this to https it all worked normally.
    – tonyb
    Mar 9, 2019 at 12:31

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.