Just another IT site ※IT系の記事は当方環境での実施内容となるため実施する場合は自己責任でお願いいたします。At Your Own Risk!! TURN BACK WHILE YOU CAN
PR

WordPressURLアドレスのwwwありなし両対応備忘

※IT系の記事は当方環境での実施内容となるため実施する場合は自己責任でお願いいたします。スクリプトはAI生成のものも多いのでコピー&ペーストの際は文字コードに注意ください!

URLアドレスは短い方がいいなと思いつつも、なんとなくブランド感を足すために勉強がてら入れてみる。

ムームードメインで www CNAME example.com を設定

/etc/httpd/conf.d/xxxx.conf の<VirtualHost>にServerAlias www.example.com を設定

systemctrl restart httpd

certbot certonly --webroot -w /path/to/docroot -d example.com-d www.example.com -m hoge@example.com --agree-tos

すでにwwwなし設定があるため以下のようにExpandするかと聞かれたら、(E)xpandする。

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
You have an existing certificate that contains a portion of the domains you
requested (ref: /etc/letsencrypt/renewal/xxxxxx.conf)

It contains these names: bigfoot.work

You requested these names for the new certificate: xxxxxx,
www.xxxxxx.

Do you want to expand and replace this existing certificate with the new
certificate?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(E)xpand/(C)ancel:E

 

systemctrl restart httpd

WordPressの管理画面でサイトURLを

https://example.com→https://www.example.com に変更する。

 

タイトルとURLをコピーしました