0

我在 apache web 服务器上有一个网站,我希望子文件夹之一透明地重定向到 azure web 应用程序。

  • mydomain.org -> 常规 apache 页面
  • mydomain.org/something -> 常规 apache 页面
  • mydomain.org/azure -> 重定向到 azure

但是,我需要将 url 保留在 mydomain.org 上,所以我想 - 例如 mydomain.com/azure/x/y 实际显示 azuredomain.org/x/y 的结果

我相信我可以使用带有规则的 .htaccess 来做到这一点:RewriteRule ^(.*)$ azuredomain.org/$1 [P]

但是,这会导致 azure 404 错误,提示可能“自定义域尚未在 Azure 中配置”,这实际上是正确的。

是否可以将“mydomain.org”配置为 azure 中的自定义域,但仅限于一个子文件夹(mydomain.org /azure/),同时允许所有其他 url 映射到 apache 服务器?

4

1 回答 1

0

我设法使它工作:

  1. 创建指向文件夹“azure”的子域“azure”
  2. 使用规则将 .htaccess 添加到“azure”文件夹RewriteRule ^(.*)$ azuredomain.org/$1 [P]
  3. 将记录添加到域:
  • TXT / asuid.azure / [验证ID]
  • CNAME / azure / azuredomain.org
  1. 在 Web 应用设置中添加带有子域的自定义域:azure.mydomain.org
于 2021-07-23T14:07:11.377 回答