urlRewrite设置,这的确 是个好东东
前提是:Apache2
LoadModule rewrite_module???? modules/mod_rewrite.so
和
rewriteengine on
为开的情况,,如下:
放入虚拟主机中:
<VirtualHost *>
??? ServerAdmin webmaster@dummy-host.example.com
??? DocumentRoot E:\web\htdocs
??? ServerName www.XXX.com
<IfModule mod_rewrite.c>
??RewriteEngine On
#??RewriteRule ^(.*)/archiver/((fid|tid)-[\w\-]+\.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\%3D$4&page=$3
#??RewriteRule ^(.*)/space-(username|uid)-(.+)\.html$ $1/space.php?$2=$3
??RewriteRule ^/cha-(.+)$ /index.php?q=$1
?</IfModule>
所以情况是:
http://www.xxx.com/cha-jetwong
对应的地址就是
http://www.xxx.com/index.php?q=jetwong
当然也可以整成假html页面的。
</VirtualHost>
没有评论▼