{"id":514,"date":"2012-01-29T11:40:53","date_gmt":"2012-01-29T11:40:53","guid":{"rendered":"http:\/\/www.sitekickr.com\/blog\/?p=514"},"modified":"2012-01-29T11:42:47","modified_gmt":"2012-01-29T11:42:47","slug":"htaccess-performance-penalty","status":"publish","type":"post","link":"https:\/\/www.sitekickr.com\/blog\/htaccess-performance-penalty\/","title":{"rendered":"The .htaccess performance penalty"},"content":{"rendered":"<p>Direct from <a href=\"http:\/\/httpd.apache.org\/docs\/2.0\/howto\/htaccess.html\">Apache&#39;s<\/a> documentation:<\/p>\n<p><q>When <em>AllowOverride<\/em> is set to allow the use of .htaccess files, Apache will look in every directory for .htaccess files. Thus, permitting .htaccess files causes a performance hit, whether or not you actually even use them! Also, the .htaccess file is loaded every time a document is requested.<\/q><\/p>\n<p>So, why use them?<\/p>\n<p>If your answer is because your SEO-friendly WordPress permalinks won&#39;t function without them, then you&#39;ve come to the right place!<\/p>\n<p>Just about anything that can be done in an .htaccess file can be performed within a <em>&lt;Directory&gt;<\/em> block within your httpd.conf file. Since you already have a <em>&lt;Directory&gt;<\/em> block for your site, containing the AllowOverride directive, you can simply remove AllowOverride, and append your rewrite directives in it&#39;s place.<\/p>\n<p>Example:<\/p>\n<p><code>&lt;Directory \/var\/www\/html\/mysite_com&gt;<br \/>\n\tRewriteEngine On<br \/>\n\tRewriteBase \/<br \/>\n\tRewriteRule ^index\\.php$ - [L]<br \/>\n\tRewriteCond %{REQUEST_FILENAME} !-f<br \/>\n\tRewriteCond %{REQUEST_FILENAME} !-d<br \/>\n\tRewriteRule . \/index.php [L]<br \/>\n\t&lt;\/Directory&gt;<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Direct from Apache&#39;s documentation: When AllowOverride is set to allow the use of .htaccess files, Apache will look in every directory for .htaccess files. Thus,&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"amp_status":""},"categories":[41,103],"tags":[156,118],"_links":{"self":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/514"}],"collection":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/comments?post=514"}],"version-history":[{"count":4,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/514\/revisions"}],"predecessor-version":[{"id":518,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/514\/revisions\/518"}],"wp:attachment":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/media?parent=514"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/categories?post=514"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/tags?post=514"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}