且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Azure上的Yii2 Webapp无法正常工作

更新时间:2023-09-16 21:47:22

根据您的描述,似乎您的应用程序中有一个 .htaccess 文件隐藏了 index.php 中的code>模式.由于PHP脚本由Azure Web Apps上的IIS处理,因此您可以尝试生成具有以下内容的 web.config 文件,而不是您的 .htaccess :

According your description, it seems that you have a .htaccess file in your application to hidden index.php pattern in URL. As the PHP scripts are handled by IIS on Azure Web Apps, so you can try to generate a web.config file with following content to instead your .htaccess:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>

<directoryBrowse enabled="false" />

  <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>
</system.webServer>
</configuration>

否则,您可以为我们提供完整的应用程序结构,以进行进一步的诊断.如有任何其他疑问,请随时告诉我.

Otherwise, you can provide your complete application structure for us for further diagnosis. Any further concern, please feel free to let me know.