当前位置:网站首页 > 网站建设教程 > HTML教程 > 正文

Apache伪静态html(URL Rewrite)设置法

教程管理员 发布于2023-09-30 22:08 HTML教程 191

简介: 比如我们有新闻页:/news/readmore.php?id=4875我们要做成静态页:/news/top2007,4875.html   一 打开 apache 的配置文件 httpd.conf 。 比如我们有新闻页:/news/readmore.php?id=4875
我们要做成静态页:/news/top2007,4875.html
  一 打开 apache 的配置文件 httpd.conf 。 二 将#loadmodule rewrite_module modules/mod_rewrite前面的#去掉 三 在 httpd.conf中添加: <ifmodule mod_rewrite.c>
 RewriteEngine On
 RewriteRule /news/top2007,(\d+).html$   /news/readmore\.php\?id=$1
</ifmodule>
转:http://xieyu.blog.51cto.com/213338/50493

琼ICP备09004296号-12