apache重写(rewrite)

开始重写记录,方便调试
    RewriteEngine on
    RewriteLog  "/usr/local/apache2/logs/rewrite_log"
    RewriteLogLevel  9

1,只允许某几个IP访问(伪静态), 其他跳转到百度

    RewriteCond %{REMOTE_ADDR}  !124.XXX.XX.1X6 [NC]
    RewriteCond %{REMOTE_ADDR}  !219.XXX.XX.60 [NC]
    RewriteCond %{REMOTE_ADDR}  !123.XXX.XX.93 [NC]
    RewriteRule  ^(.*)$ http://www.baidu.com/$1 [R=301]
    RewriteRule ^/(.*)\.html$ /index.php?$1 [L]

(待续)

你可能感兴趣的:(rewrite,apache重写)