打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
php 伪静态之IIS实例
http://blog.chinaunix.net/uid-11840697-id-4282742.html
分享下IIS下php伪静态的实现过程。
有的win主机IIS不支持 .htaccess 文件, 在这里指的不是本地 在本地的话用apmserv服务器可以用.htaccess 文件,用apmserv服务器环境配置伪静态可以看 php 伪静态 (url rewrite mod_rewrite 重写) 这篇文章,讲的很详细.
这里我们主要讲解httpd.ini 废话不说直接看效果~
例: www.jbxue.com/index.php
我们想让他用 www.jbxue.com/index.html 来直接访问
www.jbxue.com/newxx.php?=10 [newxx.php 是新闻的详细页面]
我们把他伪静态成为 www.jbxue.com/new-10.html
实现过程如下:httpd.ini 的源文件
[ISAPI_Rewrite]
# 3600 = 1 hour
# CacheClockRate3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
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主机的空间商基本都支持的!
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
如何在IIS环境下配置Rewrite规则
htaccess转换httpd.ini方法及案例参考
DEDE列表,内页全站伪静态,DEDECMS httpd.ini伪静态
dedecms5.7伪静态怎么设置?dede5.7伪静态设置方法七步走
wordpress程序在win和Linux系统下的伪静态设置
PHP教程 59 - 静态页面优化(2)
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服