某些客户有定制贴吧程序,.htaccess或httpd.ini伪静态设置是如何呢? 2个文件都放在/目录即可
apache环境,设置.htaccess文件:
# 如果需要启用伪静态,请将本文件重命名为.htaccess,并移动到/目录
# 然后请修改tieba.ini.php文件里的参数
RewriteEngine On
# tieba程序的真实目录
RewriteBase /hbcms/tieba
# 伪静态规则,如果搜索引擎已经收录你的网页,则不建议修改
# 如果将把.htaccess放在/目录,对tieba目录生效,则使用下面的规则
RewriteRule ^tieba/f-([0-9]+)-([0-9]+)\.html$ list_post.php?forum_id=$1&pageID=$2
RewriteRule ^tieba/p-([0-9]+)-([0-9]+)\.html$ show_post.php?id=$1&pageID=$2
RewriteRule ^tieba/index.html$ index.php
RewriteRule ^tieba/$ index.php
# 新建一个tieba目录,把.htaccess放在tieba目录里,取消下面的注释即可工作
#RewriteRule ^tieba.html$ index.php
#RewriteRule ^f-([0-9]+)-([0-9]+)\.html$ list_post.php?forum_id=$1&pageID=$2
#RewriteRule ^p-([0-9]+)-([0-9]+)\.html$ show_post.php?id=$1&pageID=$2
#RewriteRule ^index.html$ index.php
IIS环境,设置 httpd.ini文件:
[ISAPI_Rewrite]
CacheClockRate 3600
RepeatLimit 32
RewriteRule ^/tieba/f-([0-9]+)-([0-9]+)\.html /hbcms/tieba/list_post.php\?forum_id=$1&pageID=$2
RewriteRule ^/tieba/p-([0-9]+)-([0-9]+)\.html /hbcms/tieba/show_post.php\?id=$1&pageID=$2
RewriteRule ^/tieba/index.html$ /hbcms/tieba/index.php
RewriteRule ^/tieba/$ /hbcms/tieba/index.php