azure-web-app-service - 在 azure 应用程序中部署后出现 404 Not Found 错误
问题描述
我创建了一个基本的 PHP 文件并尝试通过 FTP 和 git 进行部署,在这两种情况下,URL 都指向 Hostingstart.html。我试过给https://<site-name>.azurewebsites.net/index.php
,它需要 404 Not Found。
任何人都可以帮助我吗?
解决方案
如果您使用的是Windows环境,则需要一个名为web.config的文件,如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Pretty URLs to index.php" stopProcessing="true">
<match url="^(.*)
<pre wp-pre-tag-1="">
如果您使用的是Linux环境,则需要一个文件.htaccess
,请参阅此示例。
推荐阅读
- asp-classic - ASP Classic 循环中的逻辑语句
- node.js - 如何使用 mongoose 获取 MongoDB 数据库统计信息?
- c# - 对水平 ListView 进行排序
- javascript - 为什么必须使用函数表达式来定义构造函数内部的方法?
- ssl - vaultsharp tls 身份验证失败 - 必须提供客户端证书
- amazon-s3 - 使用carrierwave/carrierwave-aws将图像上传到s3时如何设置自定义元数据?
- java - 如何加快我的代码效率?
- git - 浅克隆无法获取新的提交/分支?
- javascript - 打字稿:TypeError 未定义
- javascript - Google API:标记未显示在地图上的数组表上(javascript)