ServerAdmin tom@xxxxx.com DocumentRoot "/opt/app/php/xxxxx.img" ServerName img.xxxxx.com ServerAlias img.xxxxx.com ErrorLog "logs/img.xxxxx.com-error.log" CustomLog "/etc/httpd/logs/img.xxxxx.com.access.log" combined DirectoryIndex index.php index.html index.htm Options FollowSymLinks AllowOverride All Order allow,deny Allow from all RewriteEngine On RewriteCond %{HTTP_REFERER} !^http://xxxxx.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://xxxxx.com$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.xxxxx.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.xxxxx.com$ [NC] RewriteRule .*\.(gif|jpg|png|swf)$ http://www.xxxxx.com/nolink.jpg [R,NC] Deny from all
301重定向,老域名转向新域名,保持域名权重:
ServerAdmin tom@tom.com ServerName toooom.com ServerAlias www.toooom.com RedirectMatch Permanent ^/(.*) http://www.haolianduo.com/$1
安全配置,目录禁止执行php,exe,jsp等程序文件:
ServerAdmin tom@tom.com DocumentRoot "/opt/app/php/xxxxx.info" ServerName info.xxxxx.com ServerAlias info.xxxxx.com ErrorLog "logs/info.xxxxx.com-error.log" CustomLog "/etc/httpd/logs/info.xxxxx.com.access.log" combined DirectoryIndex index.php index.html index.htm Options FollowSymLinks AllowOverride All Order allow,deny Allow from all Deny from all Deny from all