2017-12-18 8 views
0

URL www.example.comにdefault.htmlを表示します このquestionから、最も簡単な方法は依然としてWebアプリケーションを作成することです。公開静的サイトをウェブアプリケーションとしてホストするにはどうすればよいですか?

[それを行う方法はない]

私はVS2017 ファイル - >新ソリューションを作成しようとした

- >プロジェクト - >ネットコア - > Asp.NetコアのWebアプリケーション - >空の

その後、静的ファイルをwwwrootに移動して展開しました 誰かがサイトにアクセスしたときにdefault.htmlがロードされるように変更する必要はありますか?現時点で

私はプログラムのクラスを削除する場合、私は、私はそれが静的なWebサイトであることを変更するにはどうすればよい、それはWebアプリケーションですので、理解しやすいメッセージ

Severity Code Description Project File Line Suppression State 
Error CS5001 Program does not contain a static 'Main' method suitable for an entry point 

を取得しますか?代わりに、私は、新しいWebアプリケーションを作成したindex.htmlに貼り付けるthis questionでのアドバイスに従って、上記の方法の

[良い方法、アズールでアプリを作成します。]

サイトのAzure URLに移動して、正しいコンテンツを表示できるようになりました。

次は、私が働くにはexample.comを取得する必要があります。

wwwのCNameレコードを私のDNSにサイト用のURLとともに追加しました。また、Azureのカスタムドメインに自分のドメイン名を追加しました。

私のサイトに行くと、次のエラーが表示されます。

Error 404 - Web app not found. 
The web app you have attempted to reach is not available in this Microsoft Azure App Service region. This could be due to one of several reasons: 

1. The web app owner has registered a custom domain to point to the Microsoft Azure App Service, but has not yet configured Azure to recognize it. Click here to read more. 

When an app owner wants to use a custom domain with a Microsoft Azure Web Apps web app, Azure needs to be configured to recognize the custom domain name, so that it can route the request to the appropriate server in the region. After registering the domain with a domain provider and configuring a DNS CNAME record to point to the app's Azurewebsites.net address (for example, contoso.azurewebsites.net), the web app owner also needs to go to the Azure Portal and configure the app for the new domain. Click here to learn more about configuring the custom domains for a web app. 
+0

次のhttps://docs.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-custom-domain –

+0

トリックは続けることですwww.example.comとexample.comがカスタムホスト名の下に表示されるまで –

答えて

0

私はそれを最終的に働かせました。私はステップを逃した必要がありますthe documentation

関連する問題