找回密码
 注册
搜索
热搜: 超星 读书 找书
查看: 1696|回复: 0

[【推荐】] apach rewrite 使用htaccess的办法

[复制链接]
发表于 2009-7-30 14:37:44 | 显示全部楼层 |阅读模式
摘自: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到需要加密的目录下面即可。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|网上读书园地

GMT+8, 2024-5-18 19:55 , Processed in 0.290302 second(s), 5 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表