Created
May 23, 2016 03:56
-
-
Save kurozumi/4b377a8a4d492bfc787304eebab27c89 to your computer and use it in GitHub Desktop.
【CodeIgniter】.htaccessと.htpasswdで任意のページにベーシック認証を掛ける方法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ index.php/$1 [L] | |
# http://domain/adminページのみベーシック認証を掛ける | |
<Files admin> | |
AuthName "admin" | |
AuthType Basic | |
AuthUserFile /var/www/html/codeigniter/public/.htpasswd | |
require valid-user | |
</Files> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment