Category Archives: basic

how to configure codeigniter based website for password protected apache basic auth codeigniter

Actually I want to 'password protect' my website as its still in development.
My requirement is simple if anyone try to access my site it should prompt for password (Basic apache auth style password window).
By doing following below changes in my .htaccess file its prompting for passsword but after successful login getting error

Forbidden, You don't have permission to access /xxxxx/index.php/ on this server.

#Options FollowSymLinks
Options Indexes FollowSymLinks Includes ExecCGI
   Order deny,allow
   Deny from All
   Options Indexes
   AuthType Basic
   AuthName "Private Access"
   AuthUserFile "C:\xamp_newxampp\htdocs\xxxxx\.htpasswd"
   Require valid-user
   Satisfy Any

RewriteEngine On
        RewriteBase /xxxxx/
        RewriteCond %{REQUEST_URI} ^system.*
        RewriteRule ^(.*)$ /xxxxx/index.php/$1 [L]
        #request to index.php
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ /xxxxx/index.php/$1 [L]
        RewriteCond $1 !^(index\.php|images|uploaded_images|js|css|public)
        RewriteRule ^(.*)$ /montasion/index.php/$1 [L]

I tried my hard but not able to configure it and wasted my four hours.