rewrite 指定IP和目录
<P>只允许公司IP访问指定目录,不符合的条件返回404页面。</P><P><VirtualHost *:80><BR> ServerName sg.com<BR> DocumentRoot /var/www/sg.com<BR> ErrorLog /var/log/httpd/sg.com.error.log<BR> CustomLog "|/usr/sbin/rotatelogs /var/log/httpd/sg.com.access.log 86400" combined<BR> <directory /var/www/sg.com><BR> AllowOverride All<BR> </directory></P>
<P> # <Location /><BR> # Order Allow,deny<BR> # AuthType Basic<BR> # AuthUserFile /etc/homm_htpasswd<BR> # AuthName "accman"<BR> # Require valid-user<BR> # Allow from 112.65.136.170<BR> # Satisfy Any<BR> # </Location><BR>RewriteEngine on<BR>RewriteCond %{REQUEST_URI} ^/admin/(.*)$ <BR>RewriteCond %{REMOTE_ADDR} !^112.65.136.x$<BR>RewriteRule . %1 <BR>#ErrorDocument 404 /admin</P>
<P><BR> # <Location /><BR> # Order Allow,deny<BR> # AuthType Basic<BR> # AuthUserFile /etc/homm_htpasswd<BR> # AuthName "accman"<BR> # Require valid-user<BR> # Allow from 112.65.136.x<BR> # Satisfy Any<BR> # </Location><BR></VirtualHost><BR></P>
页:
[1]