看看想想记记
« »
November 20, 2007Tech

350 views

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>

参考来源:

日志信息 »

该日志于2007-11-20 18:00由 J.et wong 发表在Tech分类下, 你可以发表评论。除了可以将这个日志以保留源地址及作者的情况下引用到你的网站或博客,还可以通过RSS 2.0订阅这个日志的所有评论。

相关日志 »

  • No Related Post

没有评论

发表评论 »

返回顶部

Switch to our mobile site