{"id":3507,"date":"2021-11-01T12:18:55","date_gmt":"2021-11-01T12:18:55","guid":{"rendered":"https:\/\/ownwebservers.com\/kb\/?p=3507"},"modified":"2021-11-01T12:18:55","modified_gmt":"2021-11-01T12:18:55","slug":"steps-to-enable-password-protection-for-htaccess","status":"publish","type":"post","link":"https:\/\/ownwebservers.com\/kb\/steps-to-enable-password-protection-for-htaccess\/","title":{"rendered":"Steps to Enable Password Protection for .htaccess?"},"content":{"rendered":"<p>In this tutorial will understand the steps to enable .htaccess password protection.<\/p>\n<p>1. Firstly, create an <strong>.htpasswd<\/strong> file together with your own username and password in any text editor and save it without the .txt extension. Encrypt the password for further protection.<\/p>\n<p>2. When visiting the link, simply enter the username and password. This may generate the code for you that you just need to copy and paste. During this example, the username was \u2018<strong>abc<\/strong>\u2019 and password too was \u2018<strong>abc<\/strong>\u2019 so the result was \u2013 <strong>abc:9476nIHW7Esgw<\/strong>. However it generates a new one each time.<\/p>\n<p>3. Next, create an .htaccess file using the code as below. Using any text editor you can save the file without the .txt extension. Also check the <strong>.htpasswd<\/strong> file\u2019s location without fail or else it won\u2019t work.<\/p>\n<p>4. It is possible to change the \u2018Login Details\u2019 to anything you wish to be displayed on the pop-up alert.<\/p>\n<blockquote><p>AuthUserFile \/home\/user\/domain\/secretfolder\/.htpasswd<br \/>\nAuthType Basic<br \/>\nAuthName \u201cLogin Details\u201d<br \/>\nRequire valid-user<\/p><\/blockquote>\n<p>5. Both these files need to be uploaded within the same folder that you wish to be secure. Now, if the other user than you tries to access that directory or any files in it, they&#8217;ll be asked for login details. So, your web directory is currently secured with the password.<\/p>\n<blockquote><p>NOTE \u2013 You won\u2019t be able to see these files on your server as they&#8217;re hidden files. you&#8217;ll read the Filezilla FTP client and check the \u201c<strong>force showing hidden files<\/strong>\u201d choice to read these files. you&#8217;ll also create these files simply in Notepad but save them without .txt extension (Save a type\u2013 choose \u201c<strong>All Files<\/strong>\u201d, then you&#8217;ll save without any extension). Just in case the Login window keeps popping up, it indicates that your login details are wrong.<\/p><\/blockquote>\n<p>That\u2019s it! You can enable password protection for .htaccess using the above given steps.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial will understand the steps to enable .htaccess password protection. 1. Firstly, create an .htpasswd file together with your own username and password in any text editor and save it without the .txt extension. Encrypt the password for further protection. 2. When visiting the link, simply enter the username and password. This may [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-3507","post","type-post","status-publish","format-standard","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v15.2.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Steps to Enable Password Protection for .htaccess? - OWS KB<\/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:\/\/ownwebservers.com\/kb\/steps-to-enable-password-protection-for-htaccess\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Steps to Enable Password Protection for .htaccess? - OWS KB\" \/>\n<meta property=\"og:description\" content=\"In this tutorial will understand the steps to enable .htaccess password protection. 1. Firstly, create an .htpasswd file together with your own username and password in any text editor and save it without the .txt extension. Encrypt the password for further protection. 2. When visiting the link, simply enter the username and password. This may [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ownwebservers.com\/kb\/steps-to-enable-password-protection-for-htaccess\/\" \/>\n<meta property=\"og:site_name\" content=\"OWS KB\" \/>\n<meta property=\"article:published_time\" content=\"2021-11-01T12:18:55+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\">\n\t<meta name=\"twitter:data1\" content=\"admin\">\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\":\"WebSite\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/#website\",\"url\":\"https:\/\/ownwebservers.com\/kb\/\",\"name\":\"OWS KB\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/ownwebservers.com\/kb\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/steps-to-enable-password-protection-for-htaccess\/#webpage\",\"url\":\"https:\/\/ownwebservers.com\/kb\/steps-to-enable-password-protection-for-htaccess\/\",\"name\":\"Steps to Enable Password Protection for .htaccess? - OWS KB\",\"isPartOf\":{\"@id\":\"https:\/\/ownwebservers.com\/kb\/#website\"},\"datePublished\":\"2021-11-01T12:18:55+00:00\",\"dateModified\":\"2021-11-01T12:18:55+00:00\",\"author\":{\"@id\":\"https:\/\/ownwebservers.com\/kb\/#\/schema\/person\/4a40fe3fe17a08ddd1d7c113668e75f2\"},\"breadcrumb\":{\"@id\":\"https:\/\/ownwebservers.com\/kb\/steps-to-enable-password-protection-for-htaccess\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ownwebservers.com\/kb\/steps-to-enable-password-protection-for-htaccess\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/steps-to-enable-password-protection-for-htaccess\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/\",\"url\":\"https:\/\/ownwebservers.com\/kb\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/steps-to-enable-password-protection-for-htaccess\/\",\"url\":\"https:\/\/ownwebservers.com\/kb\/steps-to-enable-password-protection-for-htaccess\/\",\"name\":\"Steps to Enable Password Protection for .htaccess?\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/#\/schema\/person\/4a40fe3fe17a08ddd1d7c113668e75f2\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ba5db5841d48bd7517bb2583e13983e6d2fa56a4099a0b3c61ad2daefc321303?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/ownwebservers.com\/kb\"]}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","_links":{"self":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/3507","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/comments?post=3507"}],"version-history":[{"count":1,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/3507\/revisions"}],"predecessor-version":[{"id":3508,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/3507\/revisions\/3508"}],"wp:attachment":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/media?parent=3507"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/categories?post=3507"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/tags?post=3507"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}