0

How can I protect my webapp build with Codeigniter with a htpasswd during development? I tried this but I get 500 error.

AuthType Basic
AuthName "Authenticate please"
AuthUserFile /usr/html/.htpasswd
Require valid-user

RewriteEngine on
RewriteCond $1 !^(index\.php|assets|files|css|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
Jonathan Clark
  • 19,726
  • 29
  • 111
  • 175

1 Answers1

1

Your auth looks ok to me I have below that works fine. Are you sure you've created your .htpasswd file correctly and it lives at the location you specified?

<Files *>
AuthName "Please Login"
AuthType Basic
AuthUserFile /var/www/.htpasswd
require valid-user
</Files>

I would say something is wrong with your rewrite cond and rules. Any reason you are not using the one here -> http://codeigniter.com/wiki/mod_rewrite

Henesnarfel
  • 2,129
  • 1
  • 16
  • 18