+ -
当前位置:首页 → 问答吧 → apache别名地址重写???

apache别名地址重写???

时间:2010-03-23

来源:互联网

我的web服务器配置如下:
系统:windows7
web server:apache
数据库:mysql
环境:php
我刚才查资料说是地址重写rewrite有两种方式:
一是将规则放到.htaccess中,二是在主配置文件httpd.conf中写
我现在要在httpd.conf中写,不知道放到哪里,用不用写RewriteBase,
谁能写一个在httpd.conf中的 ,能用的。
非常感谢!!

作者: haoyunkgq   发布时间: 2010-03-23

  1. <IfModule mod_Rewrite.c>
  2. RewriteEngine On
  3. RewriteRule ^(.*)/archiver/((fid|tid)-[\w\-]+\.html)$ $1/archiver/index.php?$2
  4. RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+)\.html$ $1/forumdisplay.php?fid=$2&page=$3
  5. RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/viewthread.php?tid=$2&extra=page\%3D$4&page=$3
  6. RewriteRule ^(.*)/space-(username|uid)-(.+)\.html$ $1/space.php?$2=$3
  7. RewriteRule ^(.*)/tag-(.+)\.html$ $1/tag.php?name=$2
  8. </IfModule>
复制代码

作者: scyzxp   发布时间: 2010-03-24

顶~

作者: bluenight_angel   发布时间: 2010-03-24

热门下载

更多