Discuz X1.5 htaccess和httpd.ini文件設(shè)置
發(fā)布時(shí)間:2010-11-04 17:12:03 作者:佚名
我要評(píng)論

檢查論壇所在目錄中是否存在 .htaccess 文件,如果不存在,請(qǐng)手工建立此文件。
Win32 系統(tǒng)下,無(wú)法直接建立 .htaccess 文件,您可以從其他系統(tǒng)中拷貝一份,或者在 Discuz.net 技術(shù)支持欄目中下載此文件。編輯并修改 .htaccess 文件,添加以下內(nèi)容。
# 將 RewriteEngine 模式打開
RewriteEngine On
# 修改以下語(yǔ)句中的 /discuz 為你的論壇目錄地址,如果程序放在根目錄中,請(qǐng)將 /discuz 修改為 /
RewriteBase /discuz
# Rewrite 系統(tǒng)規(guī)則請(qǐng)勿修改
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^([a-z]+)-(.+)\.html$ $1.php?rewrite=$2&%1
添加內(nèi)容時(shí),請(qǐng)遵照上面的提示,修改論壇所在的路徑,然后保存。將 .htaccess 文件上傳到論壇所在的目錄中。然后進(jìn)入論壇系統(tǒng)設(shè)的搜索引擎優(yōu)化,根據(jù)需要開啟 URL 靜態(tài)化功能。
httpd.ini文件
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
RewriteRule ^(.*)/topic-(.+)\.html\?*(.*)$ $1/portal\.php\?mod=topic&topic=$2&$3
RewriteRule ^(.*)/article-([0-9]+)\.html\?*(.*)$ $1/portal\.php\?mod=article&articleid=$2&$3
RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=forumdisplay&fid=$2&page=$3&$4
RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&$5
RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=group&fid=$2&page=$3&$4
RewriteRule ^(.*)/space-(username|uid)-(.+)\.html\?*(.*)$ $1/home\.php\?mod=space&$2=$3&$4
RewriteRule ^(.*)/([a-z]+)-(.+)\.html\?*(.*)$ $1/$2\.php\?rewrite=$3&$4
上傳到論壇根目錄下,這一回終于有用了。累死了,總算是解決了dz x1.5偽靜態(tài)設(shè)置這個(gè)問(wèn)題。
復(fù)制代碼
代碼如下:# 將 RewriteEngine 模式打開
RewriteEngine On
# 修改以下語(yǔ)句中的 /discuz 為你的論壇目錄地址,如果程序放在根目錄中,請(qǐng)將 /discuz 修改為 /
RewriteBase /discuz
# Rewrite 系統(tǒng)規(guī)則請(qǐng)勿修改
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^([a-z]+)-(.+)\.html$ $1.php?rewrite=$2&%1
添加內(nèi)容時(shí),請(qǐng)遵照上面的提示,修改論壇所在的路徑,然后保存。將 .htaccess 文件上傳到論壇所在的目錄中。然后進(jìn)入論壇系統(tǒng)設(shè)的搜索引擎優(yōu)化,根據(jù)需要開啟 URL 靜態(tài)化功能。
httpd.ini文件
復(fù)制代碼
代碼如下:[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
RewriteRule ^(.*)/topic-(.+)\.html\?*(.*)$ $1/portal\.php\?mod=topic&topic=$2&$3
RewriteRule ^(.*)/article-([0-9]+)\.html\?*(.*)$ $1/portal\.php\?mod=article&articleid=$2&$3
RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=forumdisplay&fid=$2&page=$3&$4
RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&$5
RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=group&fid=$2&page=$3&$4
RewriteRule ^(.*)/space-(username|uid)-(.+)\.html\?*(.*)$ $1/home\.php\?mod=space&$2=$3&$4
RewriteRule ^(.*)/([a-z]+)-(.+)\.html\?*(.*)$ $1/$2\.php\?rewrite=$3&$4
上傳到論壇根目錄下,這一回終于有用了。累死了,總算是解決了dz x1.5偽靜態(tài)設(shè)置這個(gè)問(wèn)題。
相關(guān)文章
Discuz! X3.4默認(rèn)模板自適應(yīng)手機(jī)與pc的方法
這是我去年自己花了一個(gè)下午一點(diǎn)點(diǎn)研究出來(lái)的,現(xiàn)在免費(fèi)貢獻(xiàn)給大家試用,代碼放入后臺(tái)統(tǒng)計(jì)即可,效果如下2020-11-16- 如果想要404頁(yè)面跟網(wǎng)站其他頁(yè)面一樣帶有頂部和底部導(dǎo)航,能顯示用戶信息怎么辦呢?今天小編就為大家介紹discuz設(shè)置嵌入式404頁(yè)面教程,來(lái)看看吧2016-05-10
Discuz X3/3.1 門戶中的Keyword和Description顯示不正確的解決方法
這篇文章主要介紹了Discuz X3/3.1 門戶中的Keyword和Description顯示不正確的解決方法,默認(rèn)顯示的是游客能看到的,而Discuz 對(duì)游客屏蔽了關(guān)鍵詞與描述,為了SEO,還是讓它正常2015-03-25Discuz提示您安裝的不是正版應(yīng)用問(wèn)題解決辦法
這篇文章主要介紹了Discuz提示您安裝的不是正版應(yīng)用問(wèn)題解決辦法,完整提示“對(duì)不起,您安裝的不是正版應(yīng)用,安裝程序無(wú)法繼續(xù)執(zhí)行”,本文使用修改PHP文件的方法解決了這個(gè)2015-03-25- 這篇文章主要介紹了Discuz和jQuery變量名沖突的3種解決方法,在開發(fā)模板或者插件時(shí)經(jīng)常遇到這個(gè)問(wèn)題,本文列出的3種方法都可以解決這個(gè)問(wèn)題,需要的朋友可以參考下2015-03-25
Discuz提示“密碼錯(cuò)誤次數(shù)過(guò)多,請(qǐng)15分鐘后重新登陸”問(wèn)題解決方法
這篇文章主要介紹了Discuz提示“密碼錯(cuò)誤次數(shù)過(guò)多,請(qǐng)15分鐘后重新登陸”問(wèn)題解決方法,本文方法適合網(wǎng)站管理員操作,不是普通網(wǎng)友可以使用的解決方法,需要的朋友可以參考下2015-03-25Discuz X2通過(guò)數(shù)據(jù)庫(kù)批量替換修改帖子內(nèi)容
帖子數(shù)量上萬(wàn),一開始是通過(guò)設(shè)置詞語(yǔ)過(guò)濾,發(fā)現(xiàn)無(wú)效果,只能通過(guò)數(shù)據(jù)庫(kù)批量替換了,具體方法請(qǐng)接著往下看2014-09-04Discuz!X3.2版設(shè)置論壇QQ在線客服號(hào)碼無(wú)法發(fā)起聊天的問(wèn)題解決辦法
這篇文章主要介紹了Discuz!X3.2版設(shè)置論壇QQ在線客服號(hào)碼無(wú)法發(fā)起聊天的問(wèn)題解決辦法,需要的朋友可以參考下2014-08-03- 這篇文章主要為大家介紹了Discuz論壇發(fā)帖技巧,需要的朋友可以參考下2014-06-21
- 這篇文章主要為大家介紹了Discuz論壇宣傳與優(yōu)化技巧,需要的朋友可以參考下2014-06-21