在我开时打开模式不一样:
apache的.htaccess配置文件是以:RewriteEngine On 将写模式打开。
Apache伪静态html(URL Rewrite)设置法
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
更多详细内容请查看:https://www.jb51.net/article/29390.htm
区别
apache不需要网站域名,而iis需要网站域名,且IIS遇到需要重写的URL有问号(?)与点(.)时,需要增加()进行转义.
区别如下:
iis:
复制代码 代码如下:
RewriteRule ^(.*)/category(d+).html$ $1/index.php?catid=$2
apache:
复制代码 代码如下:
RewriteRule ^category(d+).html$ index.php?catid=$1 [QSA,L]
apache伪静态,iis伪静态
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
更新日志
- 魏新雨《为你祈祷+新歌精逊2CD[WAV]
- 影心、明萨拉你选哪个?国外美女COS《博德3》
- 澳洲女子骑车跌入“自杀树”丛 疼痛持续9个月崩溃
- 育碧公布2024“她创力”计划:为女性游戏人提供辅导
- 刘美君.2017-千色·30总选3CD【环球】【WAV+CUE】
- 群星.2022-星河长明电视原声带【乐有奇思】【FLAC分轨】
- 陈淑桦.1995-淑桦盛开Forever【滚石】【WAV+CUE】
- 《再来一张》评测:出师成败皆系“赌”
- 《银河汉堡店》测评:我是银河走菜王!
- 《末日地带2》评测:酣畅淋漓的“和面”之旅
- 萧煌奇《没事的》[320K/MP3][96.22MB]
- 萧煌奇《没事的》[FLAC/分轨][263.38MB]
- 群星《音你而来 第6期》[320K/MP3][90.61MB]
- 交错战线爬塔攻略一览
- 战锤40K星际战士2全近战武器使用教学|近战武器连招表