Chinaunix首页 | 论坛 | 博客
  • 博客访问: 29833
  • 博文数量: 7
  • 博客积分: 610
  • 博客等级: 上士
  • 技术积分: 150
  • 用 户 组: 普通用户
  • 注册时间: 2006-07-04 23:12
文章分类

全部博文(7)

文章存档

2011年(2)

2010年(2)

2009年(3)

我的朋友

分类: 系统运维

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
 #     


阅读(293) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~