apache偽靜態(tài)與iis偽靜態(tài)規(guī)則與配置區(qū)別介紹
在我開時打開模式不一樣:
apache的.htaccess配置文件是以:RewriteEngine On 將寫模式打開。
Apache偽靜態(tài)html(URL Rewrite)設(shè)置法
phpma一 打開 Apache 的配置文件 httpd.conf 。
phpma二 將#LoadModule rewrite_module modules/mod_rewrite前面的#去掉
phpma三 在 httpd.conf中添加:
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteCond %{ENV:SCRIPT_URL} (?:index|dispbbs)[-0-9]+.html
RewriteRule ^(.*?(?:index|dispbbs))-([-0-9]+).html$ $1.php?
__is_apache_rewrite=1&__rewrite_arg=$2
</IfModule>
iis的httpd.ini配置文件是以:[ISAPI_Rewrite] 將寫模式打開。
打開你的httpd.ini,找到
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
RewriteRule ^(.*)/archiver/([a-z0-9-]+.html)$ $1/archiver/index.php?$2
RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+).html$ $1/forumdisplay.php?fid=$2&page=$3
RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+).html$ $1/viewthread.php?tid=$2&extra=page%3D$4&page=$3
RewriteRule ^(.*)/profile-(username|uid)-(.+?).html$ $1/viewpro.php?$2=$3
更多詳細內(nèi)容請查看:http://www.dhdzp.com/article/29390.htm
區(qū)別
apache不需要網(wǎng)站域名,而iis需要網(wǎng)站域名,且IIS遇到需要重寫的URL有問號(?)與點(.)時,需要增加()進行轉(zhuǎn)義.
區(qū)別如下:
iis:
RewriteRule ^(.*)/category(d+).html$ $1/index.php?catid=$2
apache:
RewriteRule ^category(d+).html$ index.php?catid=$1 [QSA,L]
- Apache服務(wù)器中使用.htaccess實現(xiàn)偽靜態(tài)URL的方法
- Apache中使非偽靜態(tài)url跳轉(zhuǎn)到偽靜態(tài)url的方法
- PHP+APACHE實現(xiàn)網(wǎng)址偽靜態(tài)
- PHP偽靜態(tài)Rewrite設(shè)置之APACHE篇
- php偽靜態(tài)之APACHE篇
- Apache偽靜態(tài)Rewrite詳解
- thinkphp路由規(guī)則使用示例詳解和偽靜態(tài)功能實現(xiàn)(apache重寫)
- apache中偽靜態(tài)配置和使用(Apache虛擬主機下Discuz偽靜態(tài))
- Apache 配置偽靜態(tài)詳細步驟
- WampServer設(shè)置apache偽靜態(tài)出現(xiàn)404 not found及You don''t have permission to access / on this server解決方法分析
相關(guān)文章
PHP程序員玩轉(zhuǎn)Linux系列 CentOS安裝使用教程
這篇文章主要為大家詳細介紹了PHP程序員玩轉(zhuǎn)Linux系列文章,CentOS安裝使用教程,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-04-04
Linux服務(wù)器磁盤空間占用情況分析與清理指南(解決方法)
為防止節(jié)假日期間服務(wù)器磁盤占用過高引起報警,需在節(jié)前檢查并清理磁盤,檢查條件包括使用率超90%、剩余空間不足30G等,通過shell腳本自動判斷并輸出異常信息,腳本及使用方法詳細介紹,感興趣的朋友一起看看吧2024-09-09
Linux中出現(xiàn)“No space left on device”錯誤的排查與解決方法
這篇文章主要給大家介紹了關(guān)于在Linux中出現(xiàn)"No space left on device"錯誤的排查與解決方法,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面來一起看看吧。2017-09-09
Linux系統(tǒng)利用cp命令實現(xiàn)強制覆蓋功能的方法
cp命令是我日常學(xué)習(xí)中經(jīng)常會遇到的一個命令,下面這篇文章主要給大家介紹了關(guān)于Linux系統(tǒng)利用cp命令實現(xiàn)強制覆蓋功能的方法,并且給大家簡單的介紹了cp命令的基礎(chǔ)知識,需要的朋友可以參考借鑒,下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧。2017-11-11

