网站是php的,老服务器的伪静态是用.htaccess写的,具体代码如下
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>现在变更服务器后伪静态的规则:本空间采用的是WIN IIS6系统伪静态规则文件httpd.ini和WIN IIS7.5系统伪静态规则文件web.config,我写的httpd.ini的代码如下
[ISAPI_Rewrite]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]但是现在这个伪静态没能生效,我问了下这个新服务器的工作人员,说服务器是2008版的,语法规则和文件名都是不一样的,让我具体怎么写去百度一下,但是我找了很多也没看到关于2008版的httpd.ini应该怎么命名和语法啊。我之前也没用过httpd.ini,这个2008版的httpd.ini应该如何写我.htaccess里面的伪静态了?

解决方案 »

  1.   

    求大佬帮助,或者web.config也可以
      

  2.   

    在服务器,有个导入规则的功能,你将规则导入。
    <rewrite>
    <rules>
    <rule name="portal_topic">
    <match url="^(.*/)*topic-(.+).html\?*(.*)$" />
    <action type="Rewrite" url="{R:1}/portal.php\?mod=topic&amp;topic={R:2}&amp;{R:3}" />
    </rule>
    </rules>
    </rewrite>
    参考
      

  3.   

    如何导入能具体说下吗,这个是写到httpd.ini还是?现在我用的是虚拟主机,配置的东西改不了的
      

  4.   

    在IIS管理器,对应的网站里面,有个导入规则的功能,你将规则导入。
      

  5.   

    下面这段你测试一下看看:
    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <rewrite>
                <rules>
                    <clear />
                    <rule name="tool.apizl.com rewriteTools8" patternSyntax="ECMAScript" stopProcessing="true">
                        <match url="^(.*)" ignoreCase="false" />
                         <conditions> <add input="{REQUEST_FILENAME}" matchType="IsFile"  ignoreCase="false" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory"  ignoreCase="false" negate="true" /></conditions>
                        <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                        <action type="Rewrite" url="index.php" appendQueryString="false" />
                    </rule>
                </rules>
            </rewrite>
            <httpErrors></httpErrors>
        </system.webServer>
    </configuration>