PhpCms模塊管理:問吧偽靜態設置_PHPCms教程
教程Tag:暫無Tag,歡迎添加,賺取U幣!
一、確定服務器已經支持URL重寫

1、問吧偽靜態規則如下
二、模塊配置
位置:模塊管理---問吧--模塊配置

說明:
1、需要新增加規則的可直接點擊新建URL規則;
2、修改已有規則需要到:系統設置--相關設置--URL規則管理--管理URL規則
找到屬于問吧的模塊--根據演示示例可以知道生成的格式是什么
附加:如何修改URL規則?

規則名稱:htmlshow、show分別為內容頁偽靜態規則名稱和動態地址名稱
靜態URL規則:問吧沒生成靜態html,所以均為 否
三、Rewrite 規則的編寫
2、修改已有規則需要到:系統設置--相關設置--URL規則管理--管理URL規則
找到屬于問吧的模塊--根據演示示例可以知道生成的格式是什么
附加:如何修改URL規則?

規則名稱:htmlshow、show分別為內容頁偽靜態規則名稱和動態地址名稱
靜態URL規則:問吧沒生成靜態html,所以均為 否
以 .htaccess 為例:將規則保存到ask/目錄
1、問吧偽靜態規則如下
當問吧沒有綁定域名二級域名時:
當問吧綁定域名二級域名時:
- # 將 RewriteEngine 模式打開
- RewriteEngine On
- # 修改以下語句中的 / 為你的網站目錄地址,如果程序放在二級目錄中,如/phpcms 請將 / 修改為 /phpcms
- # 如果您在httpd.conf中已經設置了重寫規則,請去掉下面的注釋
- RewriteBase /ask
- # Rewrite Rules
- RewriteRule ^(.*)show-([0-9] )\.html$ $1/ask/show.php?id=$2
- RewriteRule ^(.*)list-([0-9] )-([a-z] )\.html$ $1/ask/list.php?catid=$2&action=$3
- RewriteRule ^(.*)list-([0-9] )-([a-z] )-([0-9])\.html$ $1/ask/list.php?catid=$2&action=$3&page=$4
# 將 RewriteEngine 模式打開 RewriteEngine On # 修改以下語句中的 / 為你的網站目錄地址,如果程序放在二級目錄中,如/phpcms 請將 / 修改為 /phpcms # 如果您在httpd.conf中已經設置了重寫規則,請去掉下面的注釋 RewriteBase /ask # Rewrite Rules RewriteRule ^(.*)show-([0-9] )\.html$ $1/ask/show.php?id=$2 RewriteRule ^(.*)list-([0-9] )-([a-z] )\.html$ $1/ask/list.php?catid=$2&action=$3 RewriteRule ^(.*)list-([0-9] )-([a-z] )-([0-9])\.html$ $1/ask/list.php?catid=$2&action=$3&page=$4
當問吧綁定域名二級域名時:
- # 將 RewriteEngine 模式打開
- RewriteEngine On
- # 修改以下語句中的 / 為你的網站目錄地址,如果程序放在二級目錄中,如/phpcms 請將 / 修改為 /phpcms
- # 如果您在httpd.conf中已經設置了重寫規則,請去掉下面的注釋
- RewriteBase /
- # Rewrite Rules
- RewriteRule ^(.*)show-([0-9] )\.html$ $1/ask/show.php?id=$2
- RewriteRule ^(.*)list-([0-9] )-([a-z] )\.html$ $1/list.php?catid=$2&action=$3
- RewriteRule ^(.*)list-([0-9] )-([a-z] )-([0-9])\.html$ $1/list.php?catid=$2&action=$3&page=$4
# 將 RewriteEngine 模式打開 RewriteEngine On # 修改以下語句中的 / 為你的網站目錄地址,如果程序放在二級目錄中,如/phpcms 請將 / 修改為 /phpcms # 如果您在httpd.conf中已經設置了重寫規則,請去掉下面的注釋 RewriteBase / # Rewrite Rules RewriteRule ^(.*)show-([0-9] )\.html$ $1/ask/show.php?id=$2 RewriteRule ^(.*)list-([0-9] )-([a-z] )\.html$ $1/list.php?catid=$2&action=$3 RewriteRule ^(.*)list-([0-9] )-([a-z] )-([0-9])\.html$ $1/list.php?catid=$2&action=$3&page=$4
相關PHPCms教程:
- 相關鏈接:
- 教程說明:
PHPCms教程-PhpCms模塊管理:問吧偽靜態設置
。