利用.htaccess的Rewrite規(guī)則實(shí)現(xiàn)Discuz論壇的偽靜態(tài)鏈接
更新時(shí)間:2010年12月02日 19:35:15 作者:
重新開放了Minidx幫助論壇,雖然目前沒什么內(nèi)容,不過順便想SEO一下,實(shí)現(xiàn)偽靜態(tài)鏈接。
在后臺開啟了“URL Rewrite”,看起來一切正常,可是點(diǎn)擊某一欄目的時(shí)候卻怎么都進(jìn)不去,顯示的依然是論壇的首頁??戳艘幌抡搲夸浵?,原來這下面并沒有自己的.htaccess文件,所以默認(rèn)使用的應(yīng)該是Godaddy主機(jī)的.htaccess,而默認(rèn)的肯定不會有針對Discuz的Rewrite規(guī)則,所以加入了下面的語句,一切都正常了~
RewriteEngine On
RewriteBase /
RewriteRule ^archiver/([a-z0-9\-]+\.html)$ archiver/index.php?$1
RewriteRule ^forum-([0-9]+)-([0-9]+)\.html$ forumdisplay.php?fid=$1&page=$2
RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ viewthread.php?tid=$1&extra=page\%3D$3&page=$2
RewriteRule ^profile-(username|uid)-(.+)\.html$ viewpro.php?$1=$2
RewriteRule ^space-(username|uid)-(.+)\.html$ space.php?$1=$2
RewriteRule ^tag-(.+)\.html$ tag.php?name=$1
注:倒數(shù)第二行是針對Discuz的SupeSite/X-Space,我并沒有安裝,實(shí)際上并不需要。
復(fù)制代碼 代碼如下:
RewriteEngine On
RewriteBase /
RewriteRule ^archiver/([a-z0-9\-]+\.html)$ archiver/index.php?$1
RewriteRule ^forum-([0-9]+)-([0-9]+)\.html$ forumdisplay.php?fid=$1&page=$2
RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ viewthread.php?tid=$1&extra=page\%3D$3&page=$2
RewriteRule ^profile-(username|uid)-(.+)\.html$ viewpro.php?$1=$2
RewriteRule ^space-(username|uid)-(.+)\.html$ space.php?$1=$2
RewriteRule ^tag-(.+)\.html$ tag.php?name=$1
注:倒數(shù)第二行是針對Discuz的SupeSite/X-Space,我并沒有安裝,實(shí)際上并不需要。
相關(guān)文章
Linux系統(tǒng)下如何實(shí)現(xiàn)修改主機(jī)名
這篇文章主要介紹了Linux系統(tǒng)下如何實(shí)現(xiàn)修改主機(jī)名問題,具有很好的參考價(jià)值,希望對大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-02-02
查看Linux內(nèi)存條數(shù)與清理內(nèi)存的命令方法
下面小編就為大家?guī)硪黄榭碙inux內(nèi)存條數(shù)與清理內(nèi)存的命令方法。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2016-11-11
nacos在linux下啟動(dòng)startup.sh報(bào)錯(cuò)問題及解決
遇到Nacos啟動(dòng)錯(cuò)誤提示“Permission denied”,可通過執(zhí)行命令chmod u+x *.sh給予startup.sh執(zhí)行權(quán)限,解決權(quán)限問題,啟動(dòng)成功,這是一種常見的解決Linux下腳本執(zhí)行權(quán)限問題的方法2023-03-03

