最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
linux apache 伪静态详细说明
时间:2011-04-29 编辑:简简单单 来源:一聚教程网
linux apache 伪静态详细说明
一 打开 apache 的配置文件 httpd.conf 。
二 将#loadmodule rewrite_module modules/mod_rewrite前面的#去掉
三 在 httpd.conf中添加:
rewriteengine on
#rewritecond %{env:script_url} (?:index|dispbbs)[-0-9]+.html
rewriterule ^(.*?(?:index|dispbbs))-([-0-9]+).html$ $1.php教程?__is_apache_rewrite=1&__rewrite_arg=$2
四 要实现asp教程帖子url到php帖子的映射,在 第三步的
rewritemap tolowercase int:tolower
rewritecond %{query_string} (?:boardid|page|id|replyid|star|skin)=d+ [nc]
rewriterule ^(.*(?:index|dispbbs)).asp$ $1.php?${tolowercase:%{query_string}}&__is_apache_rewrite=1
五 保存httpd.conf并重启apache。
下面看一下.htaccess文件写法,这是dz论坛的做法
# 将 rewriteengine 模式打开
rewriteengine on
# 修改以下语句中的 /bbs 为你的论坛目录地址,如果程序放在根目录中,请将 /bbs 修改为 /
rewritebase /bbs
# rewrite 系统规则请勿修改
rewriterule ^archiver/((fid|tid)-[w-]+.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 ^space-(username|uid)-(.+).html$ space.php?$1=$2
rewriterule ^tag-(.+).html$ tag.php?name=$1
1、修改apache 的配置文件 httpd.conf 。将#loadmodule rewrite_module modules/mod_rewrite前面的#去掉
2、在 httpd.conf中添加:
rewriteengine on
#...
相关文章
- HTML简单购物数量小程序代码展示 10-31
- html canvas实现弹幕功能 10-31
- HTML中空格表示的意义 10-31
- html area标签解读 10-31
- html使用表单标签实现注册页面代码展示 10-31
- 使用HTML截图并保存为本地图片的代码展示 10-31