{"id":6132,"date":"2017-03-03T10:59:59","date_gmt":"2017-03-03T07:59:59","guid":{"rendered":"https:\/\/unihost.com\/help\/how-enable-gzip-via-htaccess\/"},"modified":"2023-01-19T14:00:11","modified_gmt":"2023-01-19T11:00:11","slug":"how-enable-gzip-via-htaccess","status":"publish","type":"post","link":"https:\/\/unihost.com\/help\/how-enable-gzip-via-htaccess\/","title":{"rendered":"How to enable gzip compression via .htaccess"},"content":{"rendered":"<p style=\"font-family: Ubuntu, sans-serif;\">This manual\u00a0is only for those, who runs pure Apache. In\u00a0Apache + Nginx, gzip is activated by default.<\/p>\n<p><span style=\"font-family: Ubuntu, sans-serif;\"><!--more--><\/span><span style=\"font-family: Ubuntu, sans-serif;\">.htaccess \u2014 Apache web-server configuration file. It controls many parameters of directories without interfering with overall server configuration. With .htaccess you can set access privileges, create error pages, control file and folder compression etc.<\/span><\/p>\n<h2><span style=\"font-family: Ubuntu, sans-serif;\">How to enable gzip compression?<\/span><\/h2>\n<ol>\n<li><span style=\"font-family: Ubuntu, sans-serif;\">Log into\u00a0cPanel<\/span><\/li>\n<li><span style=\"font-family: Ubuntu, sans-serif;\">On the dashboard, click on\u00a0<em>File manager.<\/em><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6106 size-full\" src=\"https:\/\/unihost.com\/help\/minio.php?.\/eng-1-e1489070191173.png\" alt=\"How to enable gzip compression via .htaccess - Image 1\" width=\"1199\" height=\"244\" \/ title=\"How to enable gzip compression via .htaccess - Image 1\"><\/span><\/li>\n<li><span style=\"font-family: Ubuntu, sans-serif;\">Go to the\u00a0<em>public_html <\/em>folder<em>.<\/em><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6093 size-full\" src=\"https:\/\/unihost.com\/help\/minio.php?3-3-e1488282923436.png\" alt=\"3\" width=\"1334\" height=\"133\" \/ title=\"How to enable gzip compression via .htaccess - Image 2\"><\/span><\/li>\n<li><span style=\"font-family: Ubuntu, sans-serif;\">By default,\u00a0<em>.<\/em><span style=\"font-family: 'Ubuntu Mono', monospace;\">htaccess <span style=\"font-family: Ubuntu, sans-serif;\">is hidden<\/span><\/span>. So click the\u00a0Settings button and check the Show hidden files (dotfiles) mark.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6108 size-full\" src=\"https:\/\/unihost.com\/help\/minio.php?.\/eng-2.png\" alt=\"How to enable gzip compression via .htaccess - Image 3\" width=\"596\" height=\"109\" \/ title=\"How to enable gzip compression via .htaccess - Image 3\"><\/span><\/li>\n<li><span style=\"font-family: Ubuntu, sans-serif;\">Now click on\u00a0<em>.<\/em><span style=\"font-family: 'Ubuntu Mono', monospace;\">htaccess<\/span>\u00a0and click <i>Edit<\/i>.\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6095 size-full\" src=\"https:\/\/unihost.com\/help\/minio.php?3d38405022-e1488282894130.png\" alt=\"3d38405022\" width=\"1340\" height=\"335\" \/ title=\"How to enable gzip compression via .htaccess - Image 4\"><\/span><\/li>\n<li>Add at the end of the file:\n<pre><span style=\"font-family: 'Ubuntu Mono', monospace;\">AddOutputFilterByType DEFLATE text\/plain\r\nAddOutputFilterByType DEFLATE text\/html\r\nAddOutputFilterByType DEFLATE text\/xml\r\nAddOutputFilterByType DEFLATE text\/css\r\nAddOutputFilterByType DEFLATE application\/xml\r\nAddOutputFilterByType DEFLATE application\/xhtml+xml\r\nAddOutputFilterByType DEFLATE application\/rss+xml\r\nAddOutputFilterByType DEFLATE application\/javascript\r\nAddOutputFilterByType DEFLATE application\/x-javascript<\/span><\/pre>\n<\/li>\n<li><span style=\"font-family: Ubuntu, sans-serif;\">After you are done with the file, click on <em>Save changes<\/em>.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6112 size-full\" src=\"https:\/\/unihost.com\/help\/minio.php?.\/eng-4.png\" alt=\"How to enable gzip compression via .htaccess - Image 5\" width=\"346\" height=\"42\" \/ title=\"How to enable gzip compression via .htaccess - Image 5\"><\/span><\/li>\n<\/ol>\n<hr \/>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">Once you are done \u2014 turn on mod_deflate module in Apache. If you are running a website on a hosting, ask your support to do it for you.\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This manual\u00a0is only for those, who runs pure Apache. In\u00a0Apache + Nginx, gzip is activated by default.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[160],"tags":[446,447,448,449,450,451,452],"class_list":["post-6132","post","type-post","status-publish","format-standard","hentry","category-redirects","tag-htaccess-2","tag-apache-2","tag-css-2","tag-gzip-2","tag-html-2","tag-js-2","tag-mod_deflate-2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to enable gzip compression via .htaccess - Unihost.FAQ<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/unihost.com\/help\/how-enable-gzip-via-htaccess\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to enable gzip compression via .htaccess - Unihost.FAQ\" \/>\n<meta property=\"og:description\" content=\"This manual\u00a0is only for those, who runs pure Apache. In\u00a0Apache + Nginx, gzip is activated by default.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/unihost.com\/help\/how-enable-gzip-via-htaccess\/\" \/>\n<meta property=\"og:site_name\" content=\"Unihost.FAQ\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/unihost\/\" \/>\n<meta property=\"article:published_time\" content=\"2017-03-03T07:59:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-01-19T11:00:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/unihost.com\/help\/wp-content\/uploads\/eng-1.png\" \/>\n<meta name=\"author\" content=\"Unihost Support\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@unihost\" \/>\n<meta name=\"twitter:site\" content=\"@unihost\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Unihost Support\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/unihost.com\/help\/how-enable-gzip-via-htaccess\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/unihost.com\/help\/how-enable-gzip-via-htaccess\/\"},\"author\":{\"name\":\"Unihost Support\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a\"},\"headline\":\"How to enable gzip compression via .htaccess\",\"datePublished\":\"2017-03-03T07:59:59+00:00\",\"dateModified\":\"2023-01-19T11:00:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/unihost.com\/help\/how-enable-gzip-via-htaccess\/\"},\"wordCount\":150,\"publisher\":{\"@id\":\"https:\/\/unihost.com\/help\/#organization\"},\"image\":{\"@id\":\"https:\/\/unihost.com\/help\/how-enable-gzip-via-htaccess\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/unihost.com\/help\/wp-content\/uploads\/eng-1.png\",\"keywords\":[\".htaccess\",\"Apache\",\"css\",\"gzip\",\"html\",\"js\",\"mod_deflate\"],\"articleSection\":[\"Redirects and .htaccess rules\"],\"inLanguage\":\"en\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/unihost.com\/help\/how-enable-gzip-via-htaccess\/\",\"url\":\"https:\/\/unihost.com\/help\/how-enable-gzip-via-htaccess\/\",\"name\":\"How to enable gzip compression via .htaccess - Unihost.FAQ\",\"isPartOf\":{\"@id\":\"https:\/\/unihost.com\/help\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/unihost.com\/help\/how-enable-gzip-via-htaccess\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/unihost.com\/help\/how-enable-gzip-via-htaccess\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/unihost.com\/help\/wp-content\/uploads\/eng-1.png\",\"datePublished\":\"2017-03-03T07:59:59+00:00\",\"dateModified\":\"2023-01-19T11:00:11+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/unihost.com\/help\/how-enable-gzip-via-htaccess\/#breadcrumb\"},\"inLanguage\":\"en\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/unihost.com\/help\/how-enable-gzip-via-htaccess\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\/\/unihost.com\/help\/how-enable-gzip-via-htaccess\/#primaryimage\",\"url\":\"https:\/\/unihost.com\/help\/minio.php?eng-1.png\",\"contentUrl\":\"https:\/\/unihost.com\/help\/minio.php?eng-1.png\",\"width\":1199,\"height\":244},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/unihost.com\/help\/how-enable-gzip-via-htaccess\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Unihost\",\"item\":\"https:\/\/unihost.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Help\",\"item\":\"https:\/\/unihost.com\/help\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to enable gzip compression via .htaccess\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/unihost.com\/help\/#website\",\"url\":\"https:\/\/unihost.com\/help\/\",\"name\":\"Unihost.FAQ\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/unihost.com\/help\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/unihost.com\/help\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/unihost.com\/help\/#organization\",\"name\":\"Unihost\",\"alternateName\":\"Unihost\",\"url\":\"https:\/\/unihost.com\/help\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png\",\"contentUrl\":\"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png\",\"width\":300,\"height\":300,\"caption\":\"Unihost\"},\"image\":{\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/unihost\/\",\"https:\/\/x.com\/unihost\",\"https:\/\/www.instagram.com\/unihost\/?hl=en\",\"https:\/\/www.linkedin.com\/company\/unihost-com\",\"https:\/\/www.youtube.com\/channel\/UCITKsxMDnslQY8brN3advgw\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a\",\"name\":\"Unihost Support\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g\",\"caption\":\"Unihost Support\"},\"sameAs\":[\"https:\/\/unihost.com\/\"],\"url\":\"https:\/\/unihost.com\/help\/author\/support\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to enable gzip compression via .htaccess - Unihost.FAQ","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/unihost.com\/help\/how-enable-gzip-via-htaccess\/","og_locale":"en_US","og_type":"article","og_title":"How to enable gzip compression via .htaccess - Unihost.FAQ","og_description":"This manual\u00a0is only for those, who runs pure Apache. In\u00a0Apache + Nginx, gzip is activated by default.","og_url":"https:\/\/unihost.com\/help\/how-enable-gzip-via-htaccess\/","og_site_name":"Unihost.FAQ","article_publisher":"https:\/\/www.facebook.com\/unihost\/","article_published_time":"2017-03-03T07:59:59+00:00","article_modified_time":"2023-01-19T11:00:11+00:00","og_image":[{"url":"https:\/\/unihost.com\/help\/wp-content\/uploads\/eng-1.png","type":"","width":"","height":""}],"author":"Unihost Support","twitter_card":"summary_large_image","twitter_creator":"@unihost","twitter_site":"@unihost","twitter_misc":{"Written by":"Unihost Support","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/unihost.com\/help\/how-enable-gzip-via-htaccess\/#article","isPartOf":{"@id":"https:\/\/unihost.com\/help\/how-enable-gzip-via-htaccess\/"},"author":{"name":"Unihost Support","@id":"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a"},"headline":"How to enable gzip compression via .htaccess","datePublished":"2017-03-03T07:59:59+00:00","dateModified":"2023-01-19T11:00:11+00:00","mainEntityOfPage":{"@id":"https:\/\/unihost.com\/help\/how-enable-gzip-via-htaccess\/"},"wordCount":150,"publisher":{"@id":"https:\/\/unihost.com\/help\/#organization"},"image":{"@id":"https:\/\/unihost.com\/help\/how-enable-gzip-via-htaccess\/#primaryimage"},"thumbnailUrl":"https:\/\/unihost.com\/help\/wp-content\/uploads\/eng-1.png","keywords":[".htaccess","Apache","css","gzip","html","js","mod_deflate"],"articleSection":["Redirects and .htaccess rules"],"inLanguage":"en"},{"@type":"WebPage","@id":"https:\/\/unihost.com\/help\/how-enable-gzip-via-htaccess\/","url":"https:\/\/unihost.com\/help\/how-enable-gzip-via-htaccess\/","name":"How to enable gzip compression via .htaccess - Unihost.FAQ","isPartOf":{"@id":"https:\/\/unihost.com\/help\/#website"},"primaryImageOfPage":{"@id":"https:\/\/unihost.com\/help\/how-enable-gzip-via-htaccess\/#primaryimage"},"image":{"@id":"https:\/\/unihost.com\/help\/how-enable-gzip-via-htaccess\/#primaryimage"},"thumbnailUrl":"https:\/\/unihost.com\/help\/wp-content\/uploads\/eng-1.png","datePublished":"2017-03-03T07:59:59+00:00","dateModified":"2023-01-19T11:00:11+00:00","breadcrumb":{"@id":"https:\/\/unihost.com\/help\/how-enable-gzip-via-htaccess\/#breadcrumb"},"inLanguage":"en","potentialAction":[{"@type":"ReadAction","target":["https:\/\/unihost.com\/help\/how-enable-gzip-via-htaccess\/"]}]},{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/unihost.com\/help\/how-enable-gzip-via-htaccess\/#primaryimage","url":"https:\/\/unihost.com\/help\/minio.php?eng-1.png","contentUrl":"https:\/\/unihost.com\/help\/minio.php?eng-1.png","width":1199,"height":244},{"@type":"BreadcrumbList","@id":"https:\/\/unihost.com\/help\/how-enable-gzip-via-htaccess\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Unihost","item":"https:\/\/unihost.com\/"},{"@type":"ListItem","position":2,"name":"Help","item":"https:\/\/unihost.com\/help\/"},{"@type":"ListItem","position":3,"name":"How to enable gzip compression via .htaccess"}]},{"@type":"WebSite","@id":"https:\/\/unihost.com\/help\/#website","url":"https:\/\/unihost.com\/help\/","name":"Unihost.FAQ","description":"","publisher":{"@id":"https:\/\/unihost.com\/help\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/unihost.com\/help\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en"},{"@type":"Organization","@id":"https:\/\/unihost.com\/help\/#organization","name":"Unihost","alternateName":"Unihost","url":"https:\/\/unihost.com\/help\/","logo":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/","url":"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png","contentUrl":"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png","width":300,"height":300,"caption":"Unihost"},"image":{"@id":"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/unihost\/","https:\/\/x.com\/unihost","https:\/\/www.instagram.com\/unihost\/?hl=en","https:\/\/www.linkedin.com\/company\/unihost-com","https:\/\/www.youtube.com\/channel\/UCITKsxMDnslQY8brN3advgw"]},{"@type":"Person","@id":"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a","name":"Unihost Support","image":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/unihost.com\/help\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g","caption":"Unihost Support"},"sameAs":["https:\/\/unihost.com\/"],"url":"https:\/\/unihost.com\/help\/author\/support\/"}]}},"_links":{"self":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts\/6132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/comments?post=6132"}],"version-history":[{"count":5,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts\/6132\/revisions"}],"predecessor-version":[{"id":6912,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts\/6132\/revisions\/6912"}],"wp:attachment":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/media?parent=6132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/categories?post=6132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/tags?post=6132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}