利用apache的 RewriteRule功能实现URL跳转
时间:2007-07-18 来源:玩皮鼠
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /usr/local/apache/htdocs/bbs
ServerName bbs.gamebean.com
ErrorLog logs/bbs.gamebean_error_log
CustomLog logs/bbs.gamebean-access_log common
<Directory "/usr/local/apache/htdocs/bbs">
# . RewriteEngine ....
RewriteEngine On
# ........ /discuz ....................... /discuz ... /
RewriteBase /
# Rewrite ........
RewriteRule ^archiver/([a-z0-9\-]+\.html)$ archiver/index.php?$1
RewriteRule ^forum-([0-9]+)-([0-9]+)\.html$ forumdisplay.php?fid=$1&page=$2
RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ viewthread.php?tid=$1&extra=page\%3D$3&page=$2
RewriteRule ^profile-(username|uid)-(.+)\.html$ viewpro.php?$1=$2
RewriteRule ^space-(username|uid)-(.+)\.html$ space.php?$1=$2
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/plain text/xml
AddOutputFilter DEFLATE htm html php xml js
</Directory>
</VirtualHost>