Skip to content

Instantly share code, notes, and snippets.

@kurozumi kurozumi/.haccess
Created May 23, 2016

Embed
What would you like to do?
【CodeIgniter】.htaccessと.htpasswdで任意のページにベーシック認証を掛ける方法
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
You can’t perform that action at this time.