1、开启/关闭拼写检查(关闭后会区分大小写)
CheckSpelling On #开启CheckSpelling Off #关闭关闭拼写检查可以解决一下报错2、禁止/只允许特定IP访问(1) 禁止单个IP访问,例如192.168.1.1Order Allow,DenyAllow from allDeny from 192.168.1.1(2) 禁止IP段访问,例如192.168.1.0/24、192.168.0.0/16Order Allow,DenyAllow from allDeny from 192.168.1Deny from 192.168(3) 只允许特定IP访问,例如192.168.1.1Order Allow,DenyDeny from allAllow from 192.168.1.13、防止目录浏览Options All -Indexes4、自定义错误页面ErrorDocument 403 /403.htmlErrorDocument 404 /404.htmlErrorDocument 500 /500.html5、设置默认首页DirectoryIndex 123.html6、屏蔽恶意蜘蛛(User Agent)SetEnvIfNoCase User-Agent "^Baidu" bad_botSetEnvIfNoCase User-Agent "^sogou" bad_botSetEnvIfNoCase User-Agent "^Bloghoo" bad_botSetEnvIfNoCase User-Agent "^Scooter" bad_botDeny from env=bad_bot7、防盗链RewriteEngine onRewriteCond %{HTTP_REFERER} !^$ [NC]RewriteCond %{HTTP_REFERER} !google.com [NC] #白名单域名,谷歌RewriteCond %{HTTP_REFERER} !baidu.com [NC] #白名单域名,百度RewriteCond %{HTTP_REFERER} !test.com [NC] #白名单域名,自己的域名添加上RewriteRule .*\.(jpg|gif|png|jpeg)$ http://deny.com [R,NC,L] #不在白名单的访问跳转到特定url上8、禁止访问特定目录,例如拒绝任何人访问abc目录在abc目录下创建.htaccess,写入一下内容:deny from all9、http跳转到httpsRewriteCond %{SERVER_PORT} !^443$RewriteRule ^.* https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
