.htaccessを有効にする

ディレクトリ(とそのサブディレクトリ)単位のアクセス権などを設定するのに、.htaccessというファイルが用いられる。詳しくはhttp://www.mikeneko.ne.jp/~lab/web/htaccess/index.htmlを参照。

デフォルトの設定では、.htaccessは無効となっていた。 有効にする方法は、

Directory "/var/www/html"> のAllowOverride? をallに変更して、.htaccessを有効にする

最終的には、httpd.confは以下のようになった。

<Directory "/var/www/html">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI Multiviews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important.  Please see
# http://httpd.apache.org/docs-2.0/mod/core.html#options
# for more information.
#
    Options Indexes FollowSymLinks ExecCGI   ←ExecCGIを追加

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
#    AllowOverride None
    AllowOverride All                        ←AllowOverrideをAllに変更


#
# Controls who can get stuff from this server.
#
    Order allow,deny
    Allow from all

</Directory>

現在のアクセス:43768


トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS