2

i'm trying to protect a Category of my ecommerce with a password, so i'm using htaccess method. I'm using Prestashop, and generate an .htaccess file with its integrated module, in order to have a shortly url (with RewriteRule) Now i added at the end of that file, these lines:

<LocationMatch "/category-2">
     AuthType Basic
     AuthName "By Invitation Only"
     AuthBasicProvider file
     AuthUserFile /pwdfile    #it is in the same directory of .htaccess
     Require user pippo
</LocationMatch>

but with these lines, every page of that site gives me an "500 Internal Server Error" page. I read apache documentation, but these lines seems correct. I created pwdfile with notepad++ because i haven't access to the shell of the server, so i can't use htpasswd as adviced on apache's howto.

Any suggestion why i get this error?

Thanks

1
  • You should be also getting an error in the error log for each request explaining exactly what the error is. Can you get that more detailed error?
    – stew
    Oct 4, 2011 at 16:22

1 Answer 1

1

Pardon me, but this is so wrong and for several reasons.

  • Do not - I mean - DO NOT put the password file in the same directory as .htaccess. Your site will be owned in no time and start display nekkid pix.

  • Assuming you created .htaccess with Notepad++, and unless you saved the file with unix termination I have a feeling that apache is not going to like the CRLF termination

  • What in the universe did you put in pwdfile, given you're not using htpasswd to generate it?

  • "/pwdfile" is never going to work - an absolute pathname is needed, and it will be something like /var/www/html/blah/fuz...but I already told you that pwdfile should stay away from your DocumentRoot, did'nt I?

  • "AuthBasicProvider file" is a rather recent directive, AFAIK - the apache version on the server may not support it.

  • As a matter of policy, .htaccess should be shunned, just like basic authorization. (But this point is trivial compared with what above)

Excuse me for saying so, but it looks like you are not very familiar with what you are trying to do and your hosting is not providing the level of administrative support you need - shell access would definitely help here. Both issues need fixing.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .