两个子域指向不同的虚拟目录 [英] Two subdomains point to different virtual directory

查看:59
本文介绍了两个子域指向不同的虚拟目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

[WordPress]我们可以在Azure Web应用程序的不同虚拟目录中指向两个子域.
[Wordpress]can we point two sub domain in different virtual directory in Azure web app.
is it possible in Azure web services?

推荐答案

此讨论 主题.

You may use URL rewrite rule which takes the hostname of the request and rewrites the request URL to start with the subdomain extracted from the hostname. See this discussion thread.

如果您的要求适合,则可以为每个子域创建一个新的webapp,并将它们全部放入同一App Service计划中.看到这个 讨论线程 以获取更多详细信息.

If your requirement fits, you could create new webapp for each subdomain and place them all into the same App Service plan. See this discussion thread for more details.

 

此外,默认情况下,App Service将网络请求定向到您的应用程序代码的根目录.但是,某些Web框架并非以 根目录.例如, ,Laravel开始于public子目录.要继续使用contoso.com DNS示例,可以在http://contoso.com/public上访问此类应用, 但您确实希望直接将http://contoso.com 定向到public目录.此步骤不涉及DNS解析,而是自定义虚拟目录.签出文件 重定向到自定义目录 有关此主题的详细信息.

Furthermore, by default, App Service directs web requests to the root directory of your app code. However, certain web frameworks don't start in the root directory. For example, Laravel starts in the public subdirectory. To continue the contoso.com DNS example, such an app would be accessible at http://contoso.com/public, but you would really want to direct http://contoso.com to the public directory instead. This step doesn't involve DNS resolution, but customizing the virtual directory. Checkout the document Redirect to a custom directory for details on this topic.

------ -------------------------------------------------- -------------------------------------------------- ------

如果此答案有帮助,请单击标记为答案"或投票.要提供有关您的论坛体验的其他反馈,请单击 .

If this answer was helpful, click "Mark as Answer" or Up-Vote. To provide additional feedback on your forum experience, click here.


这篇关于两个子域指向不同的虚拟目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆