php win主机下实现ISAPI_Rewrite伪静态

王朝学院·作者佚名  2016-05-25
窄屏简体版  字體: 小  |  中  |  大  |  超大  

php win主机下实现ISAPI_Rewrite伪静态有的win主机iss不支持 .htaccess 文件, 我在这里指的不是本地 在本地的话用apmserv服务器可以用.htaccess 文件,用apmserv服务器环境配置伪静态可以看 php 伪静态 (url rewrite mod_rewrite 重写) 这篇文章,讲的很详细.

这里我们主要讲解httpd.ini 废话不说直接看效果~

例: www.del5.com/index.php我们想让他用 www.del5.com/index.html 来直接访问www.del5.com/newxx.php?=10 [newxx.php 是新闻的详细页面]我们把他伪静态成为 www.del5.com/new-10.html实现过程如下:httpd.ini 的源文件

[ISAPI_Rewrite]# 3600 = 1 hour# CacheClockRate 3600RepeatLimit 32# PRotect httpd.ini and httpd.parse.errors files# from accessing through HTTPRewriteRule ^/httpd(?:\.ini|\.parse\.errors).* [F,I,O]RewriteRule /index.html /index.phpRewriteRule /new-([0-9]+).html$ /newxx\.php\?uid=$1上面的例子可以看出 RewriteRule /index.html /index.php 是把index.php 转换为 index.htmlRewriteRule /new-([0-9]+).html$ /newxx\.php\?uid=$1 转换为 new-10{这个10为id=几的值}.html

很简单吧。 这种伪静态一般 win主机的空间商基本都支持的!

 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
© 2005- 王朝網路 版權所有 導航