全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 2804|回复: 17

[疑问] 40分悬赏!httpd.ini 转成web.config,万分火急!

[复制链接]
发表于 2011-3-30 23:06:21 | 显示全部楼层 |阅读模式
IIS 7 下不能用httpd.ini 伪静态吗?怎么转成web.config?

好像IIS 6 是能httpd.ini 伪静态地。IIS 7 下能用httpd.ini吗?
如果不能用,请高手帮忙转成web.config的。
httpd.ini 源码如下。谢谢大哥大姐们了!
  1. [ISAPI_Rewrite]

  2. RewriteRule (.*)sort/([0-9]+)/([0-9]+).html$ $1sort.php\?sortid=$2&page=$3 [L]
  3. RewriteRule (.*)over/([0-9]+).html$ $1over.php\?page=$2 [L]
  4. RewriteRule (.*)top/(.*)/([0-9]+).html$ $1top.php\?topid=$2&page=$3 [L]
  5. RewriteRule (.*)topover/(.*)/([0-9]+).html$ $1topover.php\?topid=$2&page=$3 [L]
  6. RewriteRule (.*)book/([0-9]+).html$ $1book.php\?bookid=$2 [L]
  7. RewriteRule (.*)down/(.*)/([0-9]+).html$ $1down.php\?bookid=$3&type=$2 [L]
  8. RewriteRule (.*)readend/([0-9]+).html$ $1readend.php\?bookid=$2 [L]
  9. RewriteRule (.*)read/([0-9]+)/([0-9]+).html$ $1read.php\?cutid=$2&bookid=$3 [L]
  10. RewriteRule (.*)chapter/([0-9]+)/([0-9]+)/([0-9]+).html$ $1chapter.php\?cutid=$2&bookid=$3&chapterid=$4 [L]
复制代码
我照着10楼朋友的提示,修改的 web.config 文件如下,只有一个R 如{R:1}的这样的有效,出现多个R如 {R:1}&{R:1}
这样的错误,请问要怎么修改?
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <configuration>
  3. <system.webServer>
  4.         <rewrite>
  5.             <rules>
  6.                                 <rule name="sort">
  7.                     <match url="^sort/([0-9]+)/([0-9]+).html$" ignoreCase="false" />
  8.                     <action type="Rewrite" url="sort.php?sortid={R:1}&page={R:2}" appendQueryString="false" />
  9.                 </rule>
  10.                                 <rule name="over">
  11.                     <match url="^over/([0-9]+).html$" ignoreCase="false" />
  12.                     <action type="Rewrite" url="over.php?page={R:1}" appendQueryString="false" />
  13.                 </rule>
  14.                                 <rule name="top">
  15.                                     <match url="^top/(.*)/([0-9]+).html$" ignoreCase="false" />
  16.                     <action type="Rewrite" url="top.php?topid={R:1}&page={R:2}" appendQueryString="false" />
  17.                                 </rule>
  18.                                 <rule name="topover">
  19.                                     <match url="^topover/(.*)/([0-9]+).html$" ignoreCase="false" />
  20.                     <action type="Rewrite" url="topover.php?topid={R:1}&page={R:2}" appendQueryString="false" />
  21.                                 </rule>
  22.                                 <rule name="book">
  23.                                     <match url="^book/([0-9]+).html$" ignoreCase="false" />
  24.                     <action type="Rewrite" url="book.php?bookid={R:1}"  appendQueryString="false" />
  25.                                 </rule>
  26.                 <rule name="down">
  27.                                     <match url="^down/(.*)/([0-9]+).html$" ignoreCase="false" />
  28.                     <action type="Rewrite" url="down.php?bookid={R:2}&type={R:1}" appendQueryString="false" />
  29.                                 </rule>
  30.                                 <rule name="readend">
  31.                                     <match url="^readend/([0-9]+).html$" ignoreCase="false" />
  32.                     <action type="Rewrite" url="readend.php?bookid={R:1}" appendQueryString="false" />
  33.                                 </rule>
  34.                                 <rule name="read">
  35.                                     <match url="^read/([0-9]+)/([0-9]+).html$" ignoreCase="false" />
  36.                     <action type="Rewrite" url="read.php?cutid={R:1}&bookid={R:2}" appendQueryString="false" />
  37.                                 </rule>
  38.                                 <rule name="chapter">
  39.                                     <match url="^chapter/([0-9]+)/([0-9]+)/([0-9]+).html$" ignoreCase="false" />
  40.                     <action type="Rewrite" url="chapter.php?cutid={R:1}&bookid={R:2}&chapterid={R:3}" appendQueryString="false" />
  41.                                 </rule>
  42.                                 <rule name="index.html">
  43.                     <match url="index.html" />
  44.                     <action type="Rewrite" url="index.php" />
  45.                 </rule>
  46.             </rules>
  47.         </rewrite>
  48.     </system.webServer>
  49. </configuration>
复制代码

[ 本帖最后由 blog 于 2011-3-31 19:59 编辑 ]
发表于 2011-3-30 23:07:55 | 显示全部楼层
IIS7是用Rewrite组件的
发表于 2011-3-30 23:11:14 | 显示全部楼层
用Rewrite组件,曾经弄过,需要帮忙可以PM我。
 楼主| 发表于 2011-3-30 23:13:27 | 显示全部楼层

回复 2# 的帖子

我问客服:
hello, My Site l-ba.cn need to open pseudo-static features, please help me to install IIS Rewrite components.The other windows as I use the same host, I think the l-ba.cn now use the virtual host should not open the IIS Rewrite components. But I do need to open pseudo-static, so a good search engine included. Thank you

客服回了两封信:
第一封:
Dear Valued Customer,

We are checking the issue now, kindly hold on for another update within 3 hours.

第二封:Dear Customer,

I have installed URL Rewrite in the server, you need to edit your web.config in order to us this feature.
 楼主| 发表于 2011-3-30 23:13:53 | 显示全部楼层

回复 3# 的帖子

我的是虚拟主机...
发表于 2011-3-30 23:20:41 | 显示全部楼层
目前没08的服务器,没办法帮你转换。找那些IDC看看。
发表于 2011-3-30 23:21:46 | 显示全部楼层
IIS7也可以用Rewrite组件的
 楼主| 发表于 2011-3-30 23:21:46 | 显示全部楼层

回复 6# 的帖子

马来西亚主机....
发表于 2011-3-30 23:23:05 | 显示全部楼层
IIS7和IIS6是有区别的,具体差异在哪里,因为没用过,不敢妄下结论。

评分

参与人数 1威望 +2 收起 理由
blog + 2 还是多谢!

查看全部评分

发表于 2011-3-31 02:25:53 | 显示全部楼层
参考自己改
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
        <rewrite>
            <rules>
                <rule name="news">
                    <match url="^sort/([0-9]+)/([0-9]+).html$" />
                    <action type="Rewrite" url="sort.php?sortid={R:1}&amp;id={R:2}" />
                </rule>

            </rules>
        </rewrite>
    </system.webServer>
</configuration>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2025-11-8 06:54 , Processed in 0.113672 second(s), 13 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表