分类: 系统运维
2011-06-27 18:03:59
只允许公司IP访问指定目录,不符合的条件返回404页面。
ServerName sg.com
DocumentRoot /var/www/sg.com
ErrorLog /var/log/httpd/sg.com.error.log
CustomLog "|/usr/sbin/rotatelogs /var/log/httpd/sg.com.access.log 86400" combined
AllowOverride All
#
# Order Allow,deny
# AuthType Basic
# AuthUserFile /etc/homm_htpasswd
# AuthName "accman"
# Require valid-user
# Allow from 112.65.136.170
# Satisfy Any
#
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/admin/(.*)$ [NC]
RewriteCond %{REMOTE_ADDR} !^112.65.136.x$
RewriteRule . %1 [R=404,L]
#ErrorDocument 404 /admin
#
# Order Allow,deny
# AuthType Basic
# AuthUserFile /etc/homm_htpasswd
# AuthName "accman"
# Require valid-user
# Allow from 112.65.136.x
# Satisfy Any
#