我写的很简单.htaccess并在Windows Azure网站上测试它,但是mod_rewrite在那里没有用.为什么?我如何重新配置Azure?
AddDefaultCharset utf-8上的RewriteEngine
RewriteCond%{REQUEST_FILENAME}!-f RewriteCond%{REQUEST_FILENAME}!-d
RewriteRule ^ test.html $ test.php?%{QUERY_STRING} [L]
我正在Azure上部署站点,我正在尝试为该站点编写重写规则.
我有以下代码,它的工作原理:
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Sendy all" stopProcessing="true">
<match url="^(.+?)$" ignoreCase="true" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" appendQueryString="true" />
</rule>
<rule name="Sendy all" stopProcessing="true">
<match url="^api/(.+?)$" ignoreCase="true" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Run Code Online (Sandbox Code Playgroud)
但是当我在rules标签中添加以下代码时,我收到错误消息The page cannot be displayed because an internal server error has occurred.为什么?
<rule name="Sendy all" stopProcessing="true">
<match …Run Code Online (Sandbox Code Playgroud)