Apache 配置偽靜態(tài)詳細(xì)步驟
更新時(shí)間:2010年02月28日 11:00:36 作者:
Apache配置偽靜態(tài)
dz論壇目錄下.htaccess文件內(nèi)容:
程序代碼
# 將 RewriteEngine 模式打開(kāi)
RewriteEngine On
# 修改以下語(yǔ)句中的 /bbs 為你的論壇目錄地址,如果程序放在根目錄中,請(qǐng)將 /bbs 修改為 /
RewriteBase /bbs
# Rewrite 系統(tǒng)規(guī)則請(qǐng)勿修改
RewriteRule ^archiver/((fid|tid)-[\w\-]+\.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 ^space-(username|uid)-(.+)\.html$ space.php?$1=$2
RewriteRule ^tag-(.+)\.html$ tag.php?name=$1
配置Apache;
1、修改Apache 的配置文件 httpd.conf 。將#LoadModule rewrite_module modules/mod_rewrite前面的#去掉
2、在 httpd.conf中添加:
<IfModule mod_rewrite.c>
RewriteEngine On
#...
</IfModule>
3、保存httpd.conf并重啟Apache
程序代碼
復(fù)制代碼 代碼如下:
# 將 RewriteEngine 模式打開(kāi)
RewriteEngine On
# 修改以下語(yǔ)句中的 /bbs 為你的論壇目錄地址,如果程序放在根目錄中,請(qǐng)將 /bbs 修改為 /
RewriteBase /bbs
# Rewrite 系統(tǒng)規(guī)則請(qǐng)勿修改
RewriteRule ^archiver/((fid|tid)-[\w\-]+\.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 ^space-(username|uid)-(.+)\.html$ space.php?$1=$2
RewriteRule ^tag-(.+)\.html$ tag.php?name=$1
配置Apache;
1、修改Apache 的配置文件 httpd.conf 。將#LoadModule rewrite_module modules/mod_rewrite前面的#去掉
2、在 httpd.conf中添加:
復(fù)制代碼 代碼如下:
<IfModule mod_rewrite.c>
RewriteEngine On
#...
</IfModule>
3、保存httpd.conf并重啟Apache
相關(guān)文章
linux中$符號(hào)的基礎(chǔ)用法總結(jié)
這篇文章主要給大家介紹了關(guān)于linux中$符號(hào)的基礎(chǔ)用法,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家學(xué)習(xí)或者使用linux系統(tǒng)具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2019-11-11
Linux VPS 自動(dòng)備份數(shù)據(jù)到遠(yuǎn)程主機(jī)FTP的方法
推薦GD的免費(fèi)空間,10G,并且長(zhǎng)期穩(wěn)定。備份建議設(shè)置為每天執(zhí)行一次,時(shí)間在凌晨2點(diǎn)至凌晨5點(diǎn)之間2011-11-11
Ubuntu/Debian 自有軟件包構(gòu)建私有源詳解
這篇文章主要介紹了Ubuntu/Debian 自有軟件包構(gòu)建私有源詳解的相關(guān)資料,這里介紹詳細(xì)步驟,需要的朋友可以參考下2016-11-11
Linux 6 下編譯安裝 PHP 5.6實(shí)例詳解
這篇文章主要介紹了Linux 6 下編譯安裝 PHP 5.6實(shí)例詳解的相關(guān)資料,需要的朋友可以參考下2017-04-04
Linux系統(tǒng)設(shè)置tomcat開(kāi)機(jī)自啟介紹
大家好,本篇文章主要講的是Linux系統(tǒng)設(shè)置tomcat開(kāi)機(jī)自啟介紹,感興趣的同學(xué)趕快來(lái)看一看吧,對(duì)你有幫助的話(huà)記得收藏一下,方便下次瀏覽2021-12-12

