pbdigg伪静态功能的开启

          搞了几天DIGG程序,原来本来是选用国外的PLIGG,但是对于中文支持不好,后来还是选择了PBDIGG。感觉也还不错,呵呵 先用着再说,开启伪静态也很简单

一、开启静态化:
登录PB后台,选择“系统设置”->“功能设置”->“URL重写”
目录级静态化:PATHINFO模式
页面级静态化:URL重写模式

二、服务器设置:

Apache Web Server(独立主机用户)

首先确定您使用的 Apache 版本,以及是否加载了 mod_rewrite 模块。

Apache 1.x

请检查 conf/httpd.conf 中是否存在如下两段代码:

LoadModule rewrite_module libexec/mod_rewrite.so

AddModule mod_rewrite.c

Apache 2.x

请检查 conf/httpd.conf 中是否存在如下一段代码:

LoadModule rewrite_module modules/mod_rewrite.so

如果存在,那么在配置文件(通常就是 conf/httpd.conf)中加入如下代码。此时请务必注意,如果网站使用通过虚拟主机来定义,请务必加到虚拟主机配置,即 中去,如果加在虚拟主机配置外部将可能无法使用。改好后然后将 Apache 重启。

  RewriteEngine On
  RewriteRule ^(.*)/(index-)?([0-9]+)(.html)?$ $1/index.php?page=$3
  RewriteRule ^(.*)/category(/|-)([0-9]+)-([0-9]+)(.html)?$ $1/category.php?cid=$3&page=$4
  RewriteRule ^(.*)/user(/|-)([0-9]+)-([0-9]+)(.html)?$ $1/user.php?uid=$3&page=$4
  RewriteRule ^(.*)/show(/|-)([0-9]+)-([0-9]+)(.html)?$ $1/show.php?tid=$3&page=$4

如果没有安装 mod_rewrite,您可以重新编译 Apache,并在原有 configure 的内容中加入 –enable-rewrite=shared,然后再在 Apache 配置文件中加入上述代码即可。

上面的是PB论坛里找来的。 还要 如果是LINUX支持 REWRITE ,将
 
  RewriteEngine On
  RewriteRule ^(.*)/(index-)?([0-9]+)(.html)?$ $1/index.php?page=$3
  RewriteRule ^(.*)/category(/|-)([0-9]+)-([0-9]+)(.html)?$ $1/category.php?cid=$3&page=$4
  RewriteRule ^(.*)/user(/|-)([0-9]+)-([0-9]+)(.html)?$ $1/user.php?uid=$3&page=$4
  RewriteRule ^(.*)/show(/|-)([0-9]+)-([0-9]+)(.html)?$ $1/show.php?tid=$3&page=$4

复制到记事本文件里面,传到空间再改名为  .htaccess 的文件解析,就可以了。

如果是 IIS 的,需要开启ISAPI插件进去,下面是IIS下的REWRITE插件,里面有相关说明

766

发表评论

邮箱地址不会被公开。 必填项已用*标注

click to changeSecurity Code