PhpCms模块管理:问吧伪静态设置
一、确定服务器已经支持URL重写
二、模块配置
位置:模块管理---问吧--模块配置
说明:
1、需要新增加规则的可直接点击新建URL规则;2、修改已有规则需要到:系统设置--相关设置--URL规则管理--管理URL规则
找到属于问吧的模块--根据演示示例可以知道生成的格式是什么
附加:如何修改URL规则
规则名称:htmlshow、show分别为内容页伪静态规则名称和动态地址名称
静态URL规则:问吧没生成静态html,所以均为 否
三、Rewrite 规则的编写
以 .htaccess 为例:将规则保存到ask/目录
1、问吧伪静态规则如下
当问吧没有绑定域名二级域名时:
# 将 RewriteEngine 模式打开
RewriteEngine On
# 修改以下语句中的 / 为你的网站目录地址,如果程序放在二级目录中,如/phpcms 请将 / 修改为 /phpcms
# 如果您在httpd.conf中已经设置了重写规则,请去掉下面的注释
RewriteBase
# Rewrite Rules
RewriteRule ^(.*)show-([0-9] )\$ $1/show.php?id=$2
RewriteRule ^(.*)list-([0-9] )-([a-z] )\$ $1/list.php?catid=$2&action=$3
RewriteRule ^(.*)list-([0-9] )-([a-z] )-([0-9])\$ $1/list.php?catid=$2&action=$3&page=$4
# 将 RewriteEngine 模式打开RewriteEngine On# 修改以下语句中的 / 为你的网站目录地址,如果程序放在二级目录中,如/phpcms 请将 / 修改为 /phpcms# 如果您在httpd.conf中已经设置了重写规则,请去掉下面的注释RewriteBase # Rewrite RulesRewriteRule ^(.*)show-([0-9] )\$ $1/show.php?id=$2RewriteRule ^(.*)list-([0-9] )-([a-z] )\$ $1/list.php?catid=$2&action=$3RewriteRule ^(.*)list-([0-9] )-([a-z] )-([0-9])\$ $1/list.php?catid=$2&action=$3&page=$4
当问吧绑定域名二级域名时:
# 将 RewriteEngine 模式打开
RewriteEngine On
# 修改以下语句中的 / 为你的网站目录地址,如果程序放在二级目录中,如/phpcms 请将 / 修改为 /phpcms
# 如果您在httpd.conf中已经设置了重写规则,请去掉下面的注释
RewriteBase /
# Rewrite Rules
RewriteRule ^(.*)show-([0-9] )\$ $1/show.php?id=$2
RewriteRule ^(.*)list-([0-9] )-([a-z] )\$ $1/list.php?catid=$2&action=$3
RewriteRule ^(.*)list-([0-9] )-([a-z] )-([0-9])\$ $1/list.php?catid=$2&action=$3&page=$4
# 将 RewriteEngine 模式打开RewriteEngine On# 修改以下语句中的 / 为你的网站目录地址,如果程序放在二级目录中,如/phpcms 请将 / 修改为 /phpcms# 如果您在httpd.conf中已经设置了重写规则,请去掉下面的注释RewriteBase /# Rewrite RulesRewriteRule ^(.*)show-([0-9] )\$ $1/show.php?id=$2RewriteRule ^(.*)list-([0-9] )-([a-z] )\$ $1/list.php?catid=$2&action=$3RewriteRule ^(.*)list-([0-9] )-([a-z] )-([0-9])\$ $1/list.php?catid=$2&action=$3&page=$4
免责声明:本文内容来自用户上传并发布,站点仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。请核实广告和内容真实性,谨慎使用。