|
摘自:http://wulantiankong.spaces.live ... 0F83844!1034.entry1,
首先要确认你的服务器或空间的服务器解译引擎为Apache2。
I, ps -aux | grep httpd
2, 打开httpd的AllowOverride服务。
I, 在目录/etc/httpd/conf/下找到文件httpd.conf;
II, 找到:#LoadModule rewrite_module modules/mod_rewrite.so
把前面的 # 给去掉;
III, 找到第一个 AllowOverride None 改为 AllowOverride All。
这部分修改后的文件应该如下:
#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the \"default\" to be a very restrictive set of
# features.
#
<Directory />
Options FollowSymLinks
# AllowOverride None
AllowOverride all
</Directory>
3, 重新启动网页服务器httpd。
I, /etc/rc.d/init.d/httpd restart
4, 拷贝文件.htaccess和.htpasswd到需要加密的目录下面即可。 |
|