php 伪静态之IIS篇
有的win主机IIS不支持.htaccess文件,我在这里指的不是本地在本地的话用apmserv服务器可以用.htaccess文件,用apmserv服务器环境配置伪静态可以看php伪静态(urlrewritemod_rewrite重写)这篇文章,讲的很详细.
这里我们主要讲解httpd.ini废话不说直接看效果~
例:www.nhooo.com/index.php
我们想让他用www.nhooo.com/index.html来直接访问
www.nhooo.com/newxx.php?=10[newxx.php是新闻的详细页面]
我们把他伪静态成为www.nhooo.com/new-10.html
实现过程如下:httpd.ini的源文件
[ISAPI_Rewrite]
#3600=1hour
#CacheClockRate3600
RepeatLimit32
#Protecthttpd.iniandhttpd.parse.errorsfiles
#fromaccessingthroughHTTP
RewriteRule^/httpd(?:\.ini|\.parse\.errors).*[F,I,O]
RewriteRule/index.html/index.php
RewriteRule/new-([0-9]+).html$/newxx\.php\?uid=$1上面的例子可以看出RewriteRule/index.html/index.php是把index.php转换为index.html
RewriteRule/new-([0-9]+).html$/newxx\.php\?uid=$1转换为new-10{这个10为id=几的值}.html
很简单吧。这种伪静态一般win主机的空间商基本都支持的!
热门推荐
10 新人红包祝福语简短精辟
11 幼师给毕业祝福语简短
12 生日高考祝福语妹妹简短
13 下飞机祝福语简短英文
14 元宵发客户祝福语简短
15 爸妈金婚文案祝福语简短
16 新郎朋友红包祝福语简短
17 虎年五一祝福语大全简短
18 出阁宴祝福语姐姐简短