.htaccess文件实现301重定向:
RewriteEngine on
rewritecond %{http_host} ^www.fuwuqijia.com[nc]
rewriterule ^(.*)$ http://www.fuwuqijia.com/$1 [L,R=301]
.htaccess文件实现404:
<Files ~ "^.(htaccess|htpasswd)$"> deny from all </Files>
ErrorDocument 404 /404.html //此段为功能代码
order deny,allow
.htaccess文件实现用户认证和授权
AllowOverride None //不使用“.htaccess文件”
AuthType Basic //认证类型为基本认证
AuthName"this is a test directory. please login:" //设置认证领域说明
AuthUserFile/etc/httpd/mypasswd //指定认证口令文件的所在目录和名称
Require valid-user //授权给认证口令文件中的所有用户
.htaccess文件实现防盗链
RewriteEngine on
RewriteCond %{ HTTP_REFERER } !^$
RewriteCond %{ HTTP_REFERER } !^http://(www.)?fuwuqijia.com/.*$ [NC]
RewriteRule .(gif&line;jpg)$ http://www.fuwuqijia.com/替代名 [R,L]