View source for .htaccess文件

===关于===
====这是什么====
.htaccess是Apache配置文件
===准备工作===
打开httpd.conf
file:/Doc/简体中文/通用/安全性/htaccess文件/htaccessfile_open_httpd_conf_file.jpg?caption&656x240
替换##AllowOverride None##为##AllowOverride All##
file:/Doc/简体中文/通用/安全性/htaccess文件/htaccessfile_edit_httpd_conf_file.jpg?caption&656x240
保存后重启服务器。
===开始保护===
====创建====
在**网站根目录**打开cmd
file:/Doc/简体中文/通用/安全性/htaccess文件/htaccessfile_open_command_line_on_wiki_rootdir.jpg?caption&656x240
输入**rem > .htaccess**
file:/Doc/简体中文/通用/安全性/htaccess文件/htaccessfile_create_this_file.jpg?caption&656x240
====编写====
首先,用文本编辑器打开创建好的.htaccess文件
输入##Order Allow,Deny##
file:/Doc/简体中文/通用/安全性/htaccess文件/htaccessfile_content_add_order_allow_deny.jpg?caption&656x240
回车后输入##Allow from 允许访问的IP##,用英文逗号隔开多个IP
回车后输入##Deny from 禁止访问的IP##,用英文逗号隔开多个IP
=====编写建议=====
使用##Allow from all##(允许所有IP访问)后在使用##Deny from xxx.xxx.xxx,xxx.xxx.xxx##