![]() |
.htacess password protection folder - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: .htacess password protection folder (/showthread.php?tid=26604) |
.htacess password protection folder - El Forum - 01-18-2010 [eluser]searain[/eluser] Code: RewriteEngine on This is my root .htaccess, so I tell that the folder php is not using the Rewrite for clean url, for files in the folder named as "php", it is just using regular url as it is. Such as http://www.mysite.com/php/test.php It is working fine. But then I also want to put the folder "php" under password protection So I added the following .htaccess in folder "php" Code: require valid-user Afer I did that, I didn't get password protection on the folder "php", insead, I got page not found error when I try to access http://www.mysite.com/php/test.php It seems the .htaccess in root and .htaccess in php get conflicts. Any advice to fix it? Thanks! .htacess password protection folder - El Forum - 01-18-2010 [eluser]theprodigy[/eluser] try Code: AuthUserFile /home/pathto/.htpasswd Not sure if it will work, but that is what is shown at this site .htacess password protection folder - El Forum - 01-19-2010 [eluser]searain[/eluser] http://ellislab.com/forums/viewthread/142001/#698395 This gives the answer. All I need to do is add one more line in root .htaccess RewriteCond $1 !^(401.shtml) Code: RewriteEngine on Then I can put .php under .htaccess protection. |