Apache Rewrite 实例2007-03-04 11:25
ServerAdmin host@discuz.com
文档根目录 D:/www
服务器名称 www.xiaojia.com
服务器别名 xiaojia.com xiaojia.net
错误日志 D:/www/logs/xiaojia.com-error_log
CustomLog D:/www/logs/xiaojia.com-access_log%Y%m%d 组合
# 别名 /upimg "/home/www/wwwroot/phpchina.cn/upimg/"
# Alias /wiki "/home/www/wwwroot/phpchina.cn/wiki/"
重写引擎开启
# RewriteCond %{HTTP_HOST} !111cn.net [或]
# RewriteCond %{HTTP_HOST} !www.111cn.net
# RewriteRule ^(.*)$ http://www.111cn.net$1 [R=301,L]
RewriteRule ^(.*)/archiver/([a-z0-9-] .html)$ $1/archiver/index.php?$2
RewriteRule ^(.*)/forum-([0-9] )-([0-9] ).html$ $1/forumdisplay.php?fid=$2&page=$3
RewriteRule ^(.*)/thread-([0-9] )-([0-9] )-([0-9] ).html$ $1/viewthread.php?tid=$2&extra=page=$4&page =$3
RewriteRule ^(.*)/profile-(用户名|uid)-(. ).html$ $1/viewpro.php?$2=$3
虚拟主机><script>ec(2);</script>