# 証明書エラーなしでwwwなしからwwwへ

**URL:** <https://meta.discourse.org/t/non-www-to-www-without-certificate-error/215022>\
**Category:** Self-hosting\
**Created:** [2022 年 1 月 16 日午後 5:49 UTC](https://meta.discourse.org/t/non-www-to-www-without-certificate-error/215022 "2022-01-16T17:49:07Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Elmi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elmi/32/246479_2.png) [@Elmi](https://meta.discourse.org/u/Elmi)\
**Post date:** [2022 年 1 月 16 日午後 5:49 UTC](https://meta.discourse.org/t/non-www-to-www-without-certificate-error/215022/1 "2022-01-16T17:49:07Z")

</div>

コミュニティの皆さん、こんにちは。

現在、以下の問題が発生しており、適切なアプローチを見つけるお手伝いをいただけると大変嬉しいです。

1. VultrのUbuntu 21.10サーバーにDiscourseをインストールしました。
2. デフォルト設定で進め、インストール中にLet’s Encrypt証明書（`www.example.com`用）をすでに作成しました。

私の目標は、フォーラムが`www.example.com`でのみアクセス可能であり、`example.com`ではアクセスできないようにすることです。

**現在の状況:**

- `http://example.com`は正しく`https://www.example.com`にリダイレクト（301）されます。
- `http://www.example.com`は正しく`https://www.example.com`にリダイレクト（301）されます。
- `https://example.com`は証明書エラーが発生し、正しい`https://www.example.com`にリダイレクトされません（証明書は`example.com`ではなく`www.example.com`用に発行されました）。

`https://example.com`を`https://www.example.com`にリダイレクトさせるための最善のアプローチは何ですか？また、どのように目標を達成できますか？

よろしくお願いいたします。  
Elmi

---

_[View the full topic](https://meta.discourse.org/t/non-www-to-www-without-certificate-error/215022)._
