{"id":1606,"date":"2022-06-25T18:14:52","date_gmt":"2022-06-25T09:14:52","guid":{"rendered":"https:\/\/jcl.kr:6443\/?p=1606"},"modified":"2022-06-26T11:58:52","modified_gmt":"2022-06-26T02:58:52","slug":"how-to-set-up-an-https-redirect","status":"publish","type":"post","link":"https:\/\/jcl.kr\/?p=1606","title":{"rendered":"How to set up https redirect"},"content":{"rendered":"\n<p>Even if you connect via http, you can unconditionally connect to https.<\/p>\n\n\n\n<p>It was written based on Apache on Raspbian OS, and if it is the latest version of Apache, you can do the same.<\/p>\n\n\n\n<p>Just insert one line and restart and you&#8217;re done.<\/p>\n\n\n\n<p>Very simple.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>$ sudo nano \/etc\/apache2\/sites-available\/000-default.conf<\/p><\/blockquote>\n\n\n\n<p>ServerName domain name<\/p>\n\n\n\n<p>Redirect \/ https:\/\/domain name<\/p>\n\n\n\n<p>Just put it like this.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"620\" data-src=\"https:\/\/jcl.kr:6443\/wp-content\/uploads\/2022\/06\/ssl4-1024x620.png\" alt=\"\" class=\"wp-image-1607 lazyload\" data-srcset=\"https:\/\/jcl.kr\/wp-content\/uploads\/2022\/06\/ssl4-1024x620.png 1024w, https:\/\/jcl.kr\/wp-content\/uploads\/2022\/06\/ssl4-300x182.png 300w, https:\/\/jcl.kr\/wp-content\/uploads\/2022\/06\/ssl4-768x465.png 768w, https:\/\/jcl.kr\/wp-content\/uploads\/2022\/06\/ssl4-600x363.png 600w, https:\/\/jcl.kr\/wp-content\/uploads\/2022\/06\/ssl4.png 1140w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/620;\" \/><\/figure>\n\n\n\n<p>After making changes, save them in the order of Control+O -&gt; Enter -&gt; Control+X.<\/p>\n\n\n\n<p>\u200b<\/p>\n\n\n\n<p>Then restart apache and everything will be done.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>$ sudo service apache2 restart<\/p><\/blockquote>\n\n\n\n<p>If you connect with http as below<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"74\" data-src=\"https:\/\/jcl.kr:6443\/wp-content\/uploads\/2022\/06\/ssl5-1024x74.png\" alt=\"\" class=\"wp-image-1608 lazyload\" data-srcset=\"https:\/\/jcl.kr\/wp-content\/uploads\/2022\/06\/ssl5-1024x74.png 1024w, https:\/\/jcl.kr\/wp-content\/uploads\/2022\/06\/ssl5-300x22.png 300w, https:\/\/jcl.kr\/wp-content\/uploads\/2022\/06\/ssl5-768x55.png 768w, https:\/\/jcl.kr\/wp-content\/uploads\/2022\/06\/ssl5-600x43.png 600w, https:\/\/jcl.kr\/wp-content\/uploads\/2022\/06\/ssl5.png 1280w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/74;\" \/><\/figure>\n\n\n\n<p>Automatically switches to https as shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"71\" data-src=\"https:\/\/jcl.kr:6443\/wp-content\/uploads\/2022\/06\/ssl3-1024x71.png\" alt=\"\" class=\"wp-image-1604 lazyload\" data-srcset=\"https:\/\/jcl.kr\/wp-content\/uploads\/2022\/06\/ssl3-1024x71.png 1024w, https:\/\/jcl.kr\/wp-content\/uploads\/2022\/06\/ssl3-300x21.png 300w, https:\/\/jcl.kr\/wp-content\/uploads\/2022\/06\/ssl3-768x53.png 768w, https:\/\/jcl.kr\/wp-content\/uploads\/2022\/06\/ssl3-600x41.png 600w, https:\/\/jcl.kr\/wp-content\/uploads\/2022\/06\/ssl3.png 1244w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/71;\" \/><\/figure>\n\n\n\n<p>1 minute is enough<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Even if you connect via http, you can unconditionally connect to https. It was written based on Apache on Raspbian OS, and if it is the latest version of Apache,&#8230;<\/p>\n","protected":false},"author":1,"featured_media":1604,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[108,109,106,107,49,110,104],"class_list":["post-1606","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-1","tag-apache","tag-http","tag-https","tag-linux","tag-raspberrypi","tag-redirect","tag-ssl"],"_links":{"self":[{"href":"https:\/\/jcl.kr\/index.php?rest_route=\/wp\/v2\/posts\/1606","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jcl.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jcl.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jcl.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jcl.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1606"}],"version-history":[{"count":3,"href":"https:\/\/jcl.kr\/index.php?rest_route=\/wp\/v2\/posts\/1606\/revisions"}],"predecessor-version":[{"id":1632,"href":"https:\/\/jcl.kr\/index.php?rest_route=\/wp\/v2\/posts\/1606\/revisions\/1632"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/jcl.kr\/index.php?rest_route=\/wp\/v2\/media\/1604"}],"wp:attachment":[{"href":"https:\/\/jcl.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1606"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jcl.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1606"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jcl.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1606"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}