Chinaunix首页 | 论坛 | 博客
  • 博客访问: 449671
  • 博文数量: 141
  • 博客积分: 211
  • 博客等级: 入伍新兵
  • 技术积分: 1049
  • 用 户 组: 普通用户
  • 注册时间: 2010-09-17 16:25
个人简介

如此经年,望尽千帆。

文章分类

全部博文(141)

文章存档

2014年(73)

2013年(65)

2012年(3)

我的朋友

分类: PHP

2014-06-02 11:44:36

分享下IIS下的实现过程。
有的win主机IIS不支持 .htaccess 文件, 在这里指的不是本地 在本地的话用apmserv服务器可以用.htaccess 文件,用apmserv服务器环境配置伪静态可以看 php 伪静态 (url rewrite mod_rewrite 重写) 这篇文章,讲的很详细.
这里我们主要讲解httpd.ini 废话不说直接看效果~
例:
我们想让他用 来直接访问
[newxx.php 是新闻的详细页面]
我们把他伪静态成为
实现过程如下:httpd.ini 的源文件

  1. [ISAPI_Rewrite]
  2. # 3600 = 1 hour
  3. # CacheClockRate 3600
  4. RepeatLimit 32
  5. # Protect httpd.ini and httpd.parse.errors files
  6. # from accessing through HTTP
  7. RewriteRule ^/httpd(?:\.ini|\.parse\.errors).* [F,I,O]
  8. RewriteRule /index.html /index.php
  9. 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主机的空间商基本都支持的!
阅读(849) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~