单击 Azure 平台上的内部链接站点时出现 404 错误


404 error when clicking on internal links site on the Azure platform

试图处理Microsoft Azure。放置一些应用程序,单击内部链接时每个应用程序都会发生404错误。在窗口中显示"您要查找的资源已被删除、名称已更改或暂时不可用"。这是其中之一 aska.azurewebsites.net

在本地计算机和另一个主机上,一切正常。假设问题出在设置 Azure 中。我该如何解决这个问题?

找到错误的原因。我的项目托管在 apache 服务器上,我使用了配置文件 .htaccess,但 Azure 网站服务器 - IIS 和配置文件到 web.config。例如,我使用 Yii 框架编写的项目,其中 web.config 是以下内容

<?xml version="1.0" encoding="UTF-8"?>

<rewrite>
    <rules>
    <rule name="Hide Yii Index" 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>
            <action type="Rewrite" url="index.php" appendQueryString="true" />
    </rule> 
    </rules>
</rewrite>

我希望这会帮助某人