伪静态php iis,php 伪静态之IIS篇

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

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

例: www.zzvips.com/

我们想让他用 www.zzvips.com/ 来直接访问

www.zzvips.com/newxx.php?=10 [newxx.php 是新闻的详细页面]

我们把他伪静态成为 www.zzvips.com/new-10.html

实现过程如下:httpd.ini 的源文件

[ISAPI_Rewrite]

# 3600 = 1 hour

# CacheClockRate 3600

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主机的空间商基本都支持的!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值