apache偽靜態(tài)與iis偽靜態(tài)規(guī)則與配置區(qū)別介紹
在我開時(shí)打開模式不一樣:
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
更多詳細(xì)內(nèi)容請查看:http://chabaoo.cn/article/29390.htm
區(qū)別
apache不需要網(wǎng)站域名,而iis需要網(wǎng)站域名,且IIS遇到需要重寫的URL有問號(?)與點(diǎn)(.)時(shí),需要增加()進(jìn)行轉(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實(shí)現(xiàn)偽靜態(tài)URL的方法
- Apache中使非偽靜態(tài)url跳轉(zhuǎn)到偽靜態(tài)url的方法
- PHP+APACHE實(shí)現(xiàn)網(wǎng)址偽靜態(tài)
- PHP偽靜態(tài)Rewrite設(shè)置之APACHE篇
- php偽靜態(tài)之APACHE篇
- Apache偽靜態(tài)Rewrite詳解
- thinkphp路由規(guī)則使用示例詳解和偽靜態(tài)功能實(shí)現(xiàn)(apache重寫)
- apache中偽靜態(tài)配置和使用(Apache虛擬主機(jī)下Discuz偽靜態(tài))
- Apache 配置偽靜態(tài)詳細(xì)步驟
- WampServer設(shè)置apache偽靜態(tài)出現(xiàn)404 not found及You don''t have permission to access / on this server解決方法分析
相關(guān)文章
阿里云服務(wù)器CentOS服務(wù)器初始化設(shè)置步驟
這篇文章主要介紹了阿里云服務(wù)器CentOS服務(wù)器初始化設(shè)置步驟,需要的朋友可以參考下2015-05-05解決ubuntu安裝軟件時(shí),status-code=409報(bào)錯(cuò)的問題
這篇文章主要介紹了解決ubuntu安裝軟件時(shí),status-code=409報(bào)錯(cuò)的問題,具有很好的參考價(jià)值,希望對大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2022-12-12如何在Ubuntu 18.04(實(shí)體機(jī))上配置OpenWRT的開發(fā)環(huán)境
這篇文章主要介紹了如何在Ubuntu 18.04(實(shí)體機(jī))上配置OpenWRT的開發(fā)環(huán)境,本文通過圖文并茂的形式給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2020-07-07