{"id":222,"date":"2022-01-25T18:20:00","date_gmt":"2022-01-25T17:20:00","guid":{"rendered":"https:\/\/alessandromasciadri.com\/?p=222"},"modified":"2022-01-28T22:04:31","modified_gmt":"2022-01-28T21:04:31","slug":"come-impostare-il-redirect-http-to-https-in-apache","status":"publish","type":"post","link":"https:\/\/alessandromasciadri.com\/come-impostare-il-redirect-http-to-https-in-apache\/","title":{"rendered":"Come impostare il redirect HTTP to HTTPS in Apache"},"content":{"rendered":"\t\t<div data-akihiro-type=\"ama-post\" data-akihiro-id=\"222\" class=\"akihiro akihiro-222\" data-akihiro-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"akihiro-section akihiro-top-section akihiro-element akihiro-element-1adccb1f akihiro-section-boxed akihiro-section-height-default akihiro-section-height-default\" data-id=\"1adccb1f\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"akihiro-container akihiro-column-gap-default\">\n\t\t\t\t\t<div class=\"akihiro-column akihiro-col-100 akihiro-top-column akihiro-element akihiro-element-517adf21\" data-id=\"517adf21\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"akihiro-widget-wrap akihiro-element-populated\">\n\t\t\t\t\t\t<div class=\"akihiro-element akihiro-element-f8525b2 akihiro-widget akihiro-widget-text-editor\" data-id=\"f8525b2\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Abbiamo un web server che gira su Apache e dobbiamo impostare il redirect di tutto il traffico HTTP verso HTTPS. La soluzione pi\u00f9 consigliata \u00e8 quella di modificare il file .htaccess presente nella root folder del nostro sito web.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-8c70f65 akihiro-widget akihiro-widget-heading\" data-id=\"8c70f65\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t<h2 class=\"akihiro-heading-title akihiro-size-default\">Soluzione<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-b8d91e6 akihiro-widget akihiro-widget-text-editor\" data-id=\"b8d91e6\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Rechiamoci nella cartella principale del nostro sito web ed apriamo il file .htaccess. Aggiungiamo queste righe di codice al file:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-49ec169 akihiro-widget akihiro-widget-code-highlight\" data-id=\"49ec169\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-okaidia copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-bash line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-bash\">\n\t\t\t\t\t<xmp>RewriteEngine On\nRewriteCond %{HTTPS} off\nRewriteRule ^(.*)$ https:\/\/%{HTTP_HOST}%{REQUEST_URI} [L,R=301]<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-bc04ac2 akihiro-widget akihiro-widget-text-editor\" data-id=\"bc04ac2\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Questo \u00e8 il metodo raccomandato per ridirezzionare il traffico HTTP verso HTTPS di un sito WordPress che gira su Apache.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-174ffac akihiro-widget akihiro-widget-heading\" data-id=\"174ffac\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t<h2 class=\"akihiro-heading-title akihiro-size-default\">Conclusione<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-e54d6f3 akihiro-widget akihiro-widget-text-editor\" data-id=\"e54d6f3\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>In questo articolo viene descritto come impostare il redirect del traffico HTTP verso HTTPS modificando il file .htaccess di un web server basato su Apache.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Abbiamo un web server che gira su Apache e dobbiamo impostare il redirect di tutto il traffico HTTP verso HTTPS. La soluzione pi\u00f9 consigliata \u00e8 quella di modificare il file .htaccess presente nella root folder del nostro sito web. Soluzione Rechiamoci nella cartella principale del nostro sito web ed apriamo il file .htaccess. Aggiungiamo queste [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[18,20,10],"class_list":["post-222","post","type-post","status-publish","format-standard","hentry","category-sistemistica","tag-apache","tag-linux","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/posts\/222","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/comments?post=222"}],"version-history":[{"count":9,"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/posts\/222\/revisions"}],"predecessor-version":[{"id":430,"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/posts\/222\/revisions\/430"}],"wp:attachment":[{"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/media?parent=222"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/categories?post=222"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/tags?post=222"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}