«1 2 » Pages: ( 2/2 total )
本页主题: .htaccess实用指南 打印 | 加为IE收藏 | 复制链接 | 收藏主题 | 上一主题 | 下一主题

HarbinBeer
级别: 管理员


精华: 1
发帖: 1301
活跃度: 2028 点
金钱: 10886 RMB
贡献: 0 点
注册时间:2006-10-10
最后登录:2009-01-09

 定义错误文档(Error Documents )

ErrorDocument 400 /errors/badrequest.html #定义400为http根目录下/errors/badrequest.html
ErrorDocument 404 http://yoursite/errors/notfound.html #定义404文档为http://yoursite/errors/notfound.html
ErrorDocument 401 “Authorization Required” #定义401文档直接显示Authorization Required
顶端 Posted: 2008-05-22 16:10 | 10 楼
HarbinBeer
级别: 管理员


精华: 1
发帖: 1301
活跃度: 2028 点
金钱: 10886 RMB
贡献: 0 点
注册时间:2006-10-10
最后登录:2009-01-09

 屏蔽通过代理的IP

RewriteEngine  on
RewriteCond %{HTTP:X-Forwarded-For} ^12\.34\.56\.78 [OR]
RewriteCond %{HTTP:X-Forwarded-For} ^34\.56\.78\. [OR]
RewriteCond %{HTTP:X-Forwarded-For} ^56\.78\.
RewriteRule ^.* - [G,L]
ErrorDocument  410  http://www.8-host.net/
顶端 Posted: 2008-06-05 02:58 | 11 楼
HarbinBeer
级别: 管理员


精华: 1
发帖: 1301
活跃度: 2028 点
金钱: 10886 RMB
贡献: 0 点
注册时间:2006-10-10
最后登录:2009-01-09

 屏蔽特定IP

order allow,deny
deny from 123.45.6.7
deny from 12.34.5. #整个C类地址
allow from all

通过rewrite方式
顶端 Posted: 2008-06-10 08:35 | 12 楼
HarbinBeer
级别: 管理员


精华: 1
发帖: 1301
活跃度: 2028 点
金钱: 10886 RMB
贡献: 0 点
注册时间:2006-10-10
最后登录:2009-01-09

 改变缺省目录索引页面

DirectoryIndex index.html index.php index.cgi index.pl
顶端 Posted: 2008-06-10 08:36 | 13 楼
HarbinBeer
级别: 管理员


精华: 1
发帖: 1301
活跃度: 2028 点
金钱: 10886 RMB
贡献: 0 点
注册时间:2006-10-10
最后登录:2009-01-09

 重定向

Redirect /old_dir/old_file.html http://yoursite.com/new_dir/new_file.html #重定向单个文件
Redirect /old_dir http://yoursite.com/new_dir #重定向整个目录
顶端 Posted: 2008-06-10 08:38 | 14 楼
HarbinBeer
级别: 管理员


精华: 1
发帖: 1301
活跃度: 2028 点
金钱: 10886 RMB
贡献: 0 点
注册时间:2006-10-10
最后登录:2009-01-09

 设置客户端缓存

ExpiresByType image/gif A2592000 #设置gif图像缓存一个月(从用户第一次访问开始)
ExpiresByType text/html M604800 #设置html文件缓存一周(从文件创建/修改之日起)
ExpiresDefault A86400 #所有文件默认缓存一天(从用户第一次访问开始)

#
#    说明
#
#指令:ExpiresByType=按类型设置,ExpiresDefault =默认“全局”设置
#文件MIME类型
#基于:A=访问时间,M=修改时间
#缓存时间:以秒为单位
顶端 Posted: 2008-06-10 08:49 | 15 楼
HarbinBeer
级别: 管理员


精华: 1
发帖: 1301
活跃度: 2028 点
金钱: 10886 RMB
贡献: 0 点
注册时间:2006-10-10
最后登录:2009-01-09

 禁止通过Googletranslate访问

RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} .via\ translate\.google\.com. [NC]
RewriteRule ^.* - [G,L]
ErrorDocument  410  http://www.8-host.net/
顶端 Posted: 2008-06-16 00:56 | 16 楼
HarbinBeer
级别: 管理员


精华: 1
发帖: 1301
活跃度: 2028 点
金钱: 10886 RMB
贡献: 0 点
注册时间:2006-10-10
最后登录:2009-01-09

 设定默认的页面语言

DefaultLanguage zh-CN
顶端 Posted: 2008-11-10 16:02 | 17 楼
wordpress
级别: 新手上路


精华: 0
发帖: 9
活跃度: 19 点
金钱: 9 RMB
贡献: 0 点
注册时间:2008-12-16
最后登录:2009-01-07

 

收藏先
顶端 Posted: 2008-12-16 14:36 | 18 楼
«1 2 » Pages: ( 2/2 total )
帖子浏览记录 版块浏览记录
捌号主机论坛 » 技术交流

Time now is:01-09 22:19, Gzip disabled 京ICP备06061602号
Powered by PHPWind v6.3.2 Certificate Code © 2003-08 PHPWind.com Corporation