{"id":4149,"date":"2022-02-02T09:00:48","date_gmt":"2022-02-02T09:00:48","guid":{"rendered":"https:\/\/elementor.com\/resources\/?p=4149"},"modified":"2022-03-29T14:02:24","modified_gmt":"2022-03-29T14:02:24","slug":"what-is-the-htaccess-file","status":"publish","type":"post","link":"https:\/\/elementor.com\/resources\/glossary\/what-is-the-htaccess-file\/","title":{"rendered":"What Is The .htaccess File?"},"content":{"rendered":"\n<p>A <strong>.htaccess file <\/strong>(hypertext access) is a configuration document that controls how a server functions and runs.&nbsp;<\/p>\n\n\n\n<p>Only a few web servers support the <strong>.htaccess file<\/strong>, including sites running on Apache. However, the file plays a significant role in keeping your site accessible.&nbsp;<\/p>\n\n\n\n<p>WordPress software adds a directories list to a web server upon every WP installation on a hosting account. Core directories range from wp-admin, which stores administrative files, to the wp-content directory, which houses plugins and <a href=\"https:\/\/elementor.com\/blog\/wordpress-themes\/\">themes<\/a>.&nbsp;<\/p>\n\n\n\n<p>They all keep your pages up and running. WordPress also comes with the .htaccess file. This configuration is accessible through the FTP client or hosting control panel. When you host several sites, your web server will also have several .htaccess files.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Benefits Of .htaccess Files&nbsp;<\/h2>\n\n\n\n<p>.htaccess files are essential WordPress files that can enable or disable website features hosted on the server. By default, these files manage redirects and permalink structures. Also, many WP plugins use .htaccess files to operate, including most caching and security plugins. These plugins rewrite and modify the .htaccess files to perform their functions.<\/p>\n\n\n\n<p>Made to full use, .htaccess files can execute several configuration modifications on a per-directory basis. Sophisticated modifications include:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Setting up redirects<\/strong>\u00a0\u2013 Setting a 302 redirect to your temporary domain or a\u00a0301 redirect\u00a0to move all HTTP traffic to your HTTPS site.<\/li><li><strong>Rewriting a <a class=\"wpil_keyword_link\" href=\"https:\/\/elementor.com\/blog\/url\/\"   title=\"URL\" data-wpil-keyword-link=\"linked\">URL<\/a><\/strong>\u00a0\u2013 Creating an SEO-friendly URL to increase search engine<strong> <\/strong>crawlability and\u00a0indexability.<\/li><li><strong>Enabling\u00a0hotlink protection<\/strong>\u00a0\u2013 Preventing hotlinking from your site and protecting bandwidth usage.<\/li><li><strong>Altering access restriction<\/strong>\u00a0\u2013 Whitelisting or blacklisting specific IP addresses from your site; making certain types of files inaccessible; or completely\u00a0restricting site access.<\/li><li><strong>Serving customized error pages<\/strong>\u00a0\u2013 Customizing messages that appear on your<strong>\u00a0<\/strong>\u201c<strong>404 error not found<\/strong>\u201d\u00a0pages.<\/li><li><strong>Password-protect directories<\/strong>\u00a0\u2013 Commanding that every directory requires a valid user by setting up a password and creating a <strong>.htpasswd<\/strong>\u00a0file.<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>A .htaccess file (hypertext access) is a configuration document that controls how a server functions and runs.\u00a0<\/p>\n","protected":false},"author":1292159,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_angie_page":false,"page_builder":"","footnotes":""},"categories":[15,35,31],"tags":[16],"class_list":["post-4149","post","type-post","status-publish","format-standard","hentry","category-glossary","category-hosting","category-wordpress","tag-build"],"acf":[],"_links":{"self":[{"href":"https:\/\/elementor.com\/resources\/wp-json\/wp\/v2\/posts\/4149","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elementor.com\/resources\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elementor.com\/resources\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elementor.com\/resources\/wp-json\/wp\/v2\/users\/1292159"}],"replies":[{"embeddable":true,"href":"https:\/\/elementor.com\/resources\/wp-json\/wp\/v2\/comments?post=4149"}],"version-history":[{"count":2,"href":"https:\/\/elementor.com\/resources\/wp-json\/wp\/v2\/posts\/4149\/revisions"}],"predecessor-version":[{"id":4151,"href":"https:\/\/elementor.com\/resources\/wp-json\/wp\/v2\/posts\/4149\/revisions\/4151"}],"wp:attachment":[{"href":"https:\/\/elementor.com\/resources\/wp-json\/wp\/v2\/media?parent=4149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elementor.com\/resources\/wp-json\/wp\/v2\/categories?post=4149"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elementor.com\/resources\/wp-json\/wp\/v2\/tags?post=4149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}