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主机的空间商基本都支持的!
热门推荐
9 天仙配简短祝福语
10 给长辈冬至祝福语 简短
11 生日祝福语 简短独特潮
12 康复儿童六一祝福语简短
13 端午送老师祝福语简短
14 上级生日祝福语 简短独特
15 生日祝福语 简短独特男童
16 送教授贺卡祝福语简短
17 狗年同事拜年祝福语简短
18 完成预算祝福语简短精辟