网站是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里面的伪静态了?
<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里面的伪静态了?
<rewrite>
<rules>
<rule name="portal_topic">
<match url="^(.*/)*topic-(.+).html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/portal.php\?mod=topic&topic={R:2}&{R:3}" />
</rule>
</rules>
</rewrite>
参考
<?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>