当前位置: 代码迷 >> PHP >> ISAPI_Rewrite的写法
  详细解决方案

ISAPI_Rewrite的写法

热度:14   发布时间:2016-04-28 22:39:02.0
求一个ISAPI_Rewrite的写法
要求如下
http://www.abc.com/SNSN/1.html
http://www.abc.com/SNSN/12/1.html
http://www.abc.com/SNSN/1232/43/1/21.html

现在我想把上面的SNSN替换成snsn,也就是变成如下
http://www.abc.com/snsn/1.html
http://www.abc.com/snsn/12/1.html
http://www.abc.com/snsn/1232/43/1/21.html

也就是讲一个URL 这里是固定的:http://www.abc.com/snsn   后面不是固定的

求大侠帮个忙,谢谢。
------解决方案--------------------
RewriteEngine on

# 修改以下语句中的 / 为网站目录地址,如果程序放在根目录則修改为 /
RewriteBase /

# class.html
RewriteRule ^SNSN(.*)$ snsn$1 [NC]