我的.htaccess
文件包含代码:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.domainname\.com$ [NC]
RewriteRule ^(.*)$ http://www.domainname.com/$1 [R=301,L]
RewriteRule ^(.+)\.html$ page.php?title=$1 [PT,L,QSA]
我以下列方式将该代码转换为web.config
文件:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<configSections>
<sectionGroup name="system.webServer">
<sectionGroup name="rewrite">
<section name="rewriteMaps" overrideModeDefault="Allow" />
<section name="rules" overrideModeDefault="Allow" />
</sectionGroup>
</sectionGroup>
</configSections>
<system.webServer>
<httpErrors errorMode="Detailed" />
<asp scriptErrorSentToBrowser="true"/>
<rule name="rule 1q" stopProcessing="true">
<match url="^(.*)$" />
<action type="Rewrite" url="/http://www.domainname.com/{R:1}" />
</rule>
<rule name="rule 2q" stopProcessing="true">
<match url="^(.+)\.html$" />
<action type="Rewrite" url="/page.php?title={R:1}" appendQueryString="true" />
</rule>
</system.webServer>
</configuration>
但即使这样,我也会得到500 error
。
如果有人可以提供帮助,我将感激不尽。
由于