{"id":4175,"date":"2017-10-04T14:29:00","date_gmt":"2017-10-04T14:29:00","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2017\/10\/04\/how-to-set-up-non-cached-pages-with-htaccess\/"},"modified":"2021-08-16T22:30:09","modified_gmt":"2021-08-17T02:30:09","slug":"how-to-set-up-non-cached-pages-with-htaccess","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/website\/how-to-set-up-non-cached-pages-with-htaccess\/","title":{"rendered":"How to Set Up Non-cached Pages with .htaccess"},"content":{"rendered":"<p>Cache control is one of the primary system administrative tasks you will find yourself performing. Thankfully, most browsers will take care of at least some of the caching for you, remembering certain resources that were loaded before. However, there may be occasions in which browser caching is something you don&#8217;t want. In this article, we&#8217;ll show you how to <strong>set up non-cache pages with .htaccess<\/strong>.<\/p>\n<p>For example, if you&#8217;re developing a site in a test environment and making constant changes, cached resources will likely interfere with changes you&#8217;re making. You may find yourself constantly clearing your browser cache to see the effect of your work. Or, imagine you have a static page that is updated frequently, like a client roster, or an organizational document. In cases like the latter, it would not be convenient for your visitors to constantly clear their browser caches or risk missing out on new information.<\/p>\n<h2 id=\"first-heading\">Set up non-cached pages with .htaccess<\/h2>\n<ol class=\"article_list\">\n<li>Using your favorite <a href=\"\/support\/website\/how-to-manage-files-server\/\">file management<\/a> method, open your <code>.htaccess<\/code> file for editing<\/li>\n<li>Option tip: using SSH, you can use an editor command like <code>nano .htaccess<\/code> to use the nano text editor<\/li>\n<li>Place this code into your <code>.htaccess<\/code> file:\n<pre class=\"code_block\"> &lt;filesMatch \"\\.(html|htm|js|css)$\"&gt; FileETag None   \n      &lt;ifModule mod_headers.c&gt;      \n         Header unset ETag      \n         Header set Cache-Control \"max-age=0, no-cache, no-store, must-revalidate\"      \n         Header set Pragma \"no-cache\"      \n         Header set Expires \"Wed, 11 Jan 1984 05:00:00 GMT\"   \n      &lt;\/ifModule&gt; \n&lt;\/filesMatch&gt;<\/pre>\n<\/li>\n<\/ol>\n<p><!-- Source attribution: https:\/\/stackoverflow.com\/questions\/11532636\/how-to-prevent-http-file-caching-in-apache-httpd-mamp --><\/p>\n<p>Remember that this .htaccess file will act <em>recursively<\/em> upon all files within the document path that follows. So it would be best to separate this path from any resources you want to cache. For example, a subdomain would be a great place to put this code in order to <strong>set up non-cache pages with .htaccess<\/strong>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cache control is one of the primary system administrative tasks you will find yourself performing. Thankfully, most browsers will take care of at least some of the caching for you, remembering certain resources that were loaded before. However, there may be occasions in which browser caching is something you don&#8217;t want. In this article, we&#8217;ll<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/website\/how-to-set-up-non-cached-pages-with-htaccess\/\"> Read More ><\/a><\/p>\n","protected":false},"author":17,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4288],"tags":[],"class_list":["post-4175","post","type-post","status-publish","format-standard","hentry","category-website"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Set Up Non-cached Pages with .htaccess | InMotion Hosting<\/title>\n<meta name=\"description\" content=\"In this article, you will learn how you can set up non-cached pages with .htaccess.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.inmotionhosting.com\/support\/website\/how-to-set-up-non-cached-pages-with-htaccess\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Set Up Non-cached Pages with .htaccess | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"In this article, you will learn how you can set up non-cached pages with .htaccess.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/website\/how-to-set-up-non-cached-pages-with-htaccess\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2017-10-04T14:29:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-17T02:30:09+00:00\" \/>\n<meta name=\"author\" content=\"Christopher Maiorana\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Christopher Maiorana\" \/>\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:\/\/www.inmotionhosting.com\/support\/website\/how-to-set-up-non-cached-pages-with-htaccess\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/how-to-set-up-non-cached-pages-with-htaccess\/\"},\"author\":{\"name\":\"Christopher Maiorana\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/c6922c56c84e17079fd558e07b7ef72f\"},\"headline\":\"How to Set Up Non-cached Pages with .htaccess\",\"datePublished\":\"2017-10-04T14:29:00+00:00\",\"dateModified\":\"2021-08-17T02:30:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/how-to-set-up-non-cached-pages-with-htaccess\/\"},\"wordCount\":257,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"articleSection\":[\"Website\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/website\/how-to-set-up-non-cached-pages-with-htaccess\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/how-to-set-up-non-cached-pages-with-htaccess\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/website\/how-to-set-up-non-cached-pages-with-htaccess\/\",\"name\":\"How to Set Up Non-cached Pages with .htaccess | InMotion Hosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"datePublished\":\"2017-10-04T14:29:00+00:00\",\"dateModified\":\"2021-08-17T02:30:09+00:00\",\"description\":\"In this article, you will learn how you can set up non-cached pages with .htaccess.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/how-to-set-up-non-cached-pages-with-htaccess\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/website\/how-to-set-up-non-cached-pages-with-htaccess\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/how-to-set-up-non-cached-pages-with-htaccess\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Set Up Non-cached Pages with .htaccess\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/c6922c56c84e17079fd558e07b7ef72f\",\"name\":\"Christopher Maiorana\",\"description\":\"Christopher Maiorana joined the InMotion community team in 2015 and regularly dispenses tips and tricks in the Support Center, Community Q&A, and the InMotion Hosting Blog.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/chris-m-4623144b\/\"],\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/christopherm\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Set Up Non-cached Pages with .htaccess | InMotion Hosting","description":"In this article, you will learn how you can set up non-cached pages with .htaccess.","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:\/\/www.inmotionhosting.com\/support\/website\/how-to-set-up-non-cached-pages-with-htaccess\/","og_locale":"en_US","og_type":"article","og_title":"How to Set Up Non-cached Pages with .htaccess | InMotion Hosting","og_description":"In this article, you will learn how you can set up non-cached pages with .htaccess.","og_url":"https:\/\/www.inmotionhosting.com\/support\/website\/how-to-set-up-non-cached-pages-with-htaccess\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2017-10-04T14:29:00+00:00","article_modified_time":"2021-08-17T02:30:09+00:00","author":"Christopher Maiorana","twitter_card":"summary_large_image","twitter_creator":"@InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"Christopher Maiorana","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/how-to-set-up-non-cached-pages-with-htaccess\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/how-to-set-up-non-cached-pages-with-htaccess\/"},"author":{"name":"Christopher Maiorana","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/c6922c56c84e17079fd558e07b7ef72f"},"headline":"How to Set Up Non-cached Pages with .htaccess","datePublished":"2017-10-04T14:29:00+00:00","dateModified":"2021-08-17T02:30:09+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/how-to-set-up-non-cached-pages-with-htaccess\/"},"wordCount":257,"commentCount":0,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"articleSection":["Website"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/website\/how-to-set-up-non-cached-pages-with-htaccess\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/how-to-set-up-non-cached-pages-with-htaccess\/","url":"https:\/\/www.inmotionhosting.com\/support\/website\/how-to-set-up-non-cached-pages-with-htaccess\/","name":"How to Set Up Non-cached Pages with .htaccess | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"datePublished":"2017-10-04T14:29:00+00:00","dateModified":"2021-08-17T02:30:09+00:00","description":"In this article, you will learn how you can set up non-cached pages with .htaccess.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/how-to-set-up-non-cached-pages-with-htaccess\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/website\/how-to-set-up-non-cached-pages-with-htaccess\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/how-to-set-up-non-cached-pages-with-htaccess\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"How to Set Up Non-cached Pages with .htaccess"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/c6922c56c84e17079fd558e07b7ef72f","name":"Christopher Maiorana","description":"Christopher Maiorana joined the InMotion community team in 2015 and regularly dispenses tips and tricks in the Support Center, Community Q&A, and the InMotion Hosting Blog.","sameAs":["https:\/\/www.linkedin.com\/in\/chris-m-4623144b\/"],"url":"https:\/\/www.inmotionhosting.com\/support\/author\/christopherm\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":null,"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/4175","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=4175"}],"version-history":[{"count":2,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/4175\/revisions"}],"predecessor-version":[{"id":83856,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/4175\/revisions\/83856"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=4175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=4175"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=4175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}