我在 Apache 中有一个 PHP CMS,我.htaccess
在下面:
# -FrontPage-
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
# AuthType Basic
# AuthUserFile /home/tcdgroup/.htpasswd
# AuthName tadbir-group
# Require user test
RewriteEngine On
RewriteRule ^\.htaccess$ - [F]
RewriteCond %{REQUEST_URI} =""
RewriteRule ^.*$ /public/index.php [NC,L]
RewriteCond %{REQUEST_URI} !^/public/.*$
RewriteRule ^(.*)$ /public/$1
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^.*$ - [NC,L]
RewriteRule ^public/.*$ /public/index.php [NC,L]
我想将它转换为 IIS Web 服务器的 web.config。
我搜索并找到了“URL重写”工具来翻译格式,总结如下:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1">
<match url="^\.htaccess$" ignoreCase="false" />
<action type="CustomResponse" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
</rule>
<rule name="Imported Rule 2" stopProcessing="true">
<match url="^.*$" />
<conditions logicalGrouping="MatchAll">
<add input="{URL}" pattern="^""$" ignoreCase="false" />
</conditions>
<action type="Rewrite" url="/public/index.php" />
</rule>
<rule name="Imported Rule 3">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{URL}" pattern="^/public/.*$" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="/public/{R:1}" />
</rule>
<rule name="Imported Rule 4" stopProcessing="true">
<match url="^.*$" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" />
</conditions>
<action type="None" />
</rule>
<rule name="Imported Rule 5" stopProcessing="true">
<match url="^public/.*$" />
<action type="Rewrite" url="/public/index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
但是当我将它上传到我的服务器时,会出现以下错误:
500 - 内部服务器错误。您要查找的资源有问题,无法显示。
此错误的原因可能是什么?