{"id":5571,"date":"2019-05-31T08:45:05","date_gmt":"2019-05-31T08:45:05","guid":{"rendered":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?p=5571"},"modified":"2019-05-31T08:45:05","modified_gmt":"2019-05-31T08:45:05","slug":"enable-password-protection-for-htaccess","status":"publish","type":"post","link":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/enable-password-protection-for-htaccess\/","title":{"rendered":"Steps to Enable Password Protection for .htaccess?"},"content":{"rendered":"<p>The article reveals the steps to enable .htaccess password protection.<\/p>\n<p>1. Firstly, create an <strong>.htpasswd<\/strong> file with your own username and password in any text editor and save it without the .txt extension. Encrypt the password for extra protection.<\/p>\n<p>2. After visiting the link, just enter the username and password. This will generate the code for you that you just need to copy and paste. In this example, the username was <strong>\u2018abc\u2019<\/strong> and password too was <strong>\u2018abc\u2019<\/strong> and so the result was &#8211; <strong>abc:9476nIHW7Esgw<\/strong>. But it generates a new one each time.<\/p>\n<p>3. Next, create an .htaccess file with the below code. You can use any text editor save it without the .txt extension. Don\u2019t miss to check the .<strong>htpasswd<\/strong> file\u2019s location or else it won\u2019t work.<\/p>\n<p>4. It is possible to change the \u2018Login Details\u2019 to anything you want to be displayed on the pop-up alert.<\/p>\n<pre class=\"lang:default decode:true \">AuthUserFile \/home\/user\/domain\/secretfolder\/.htpasswd\r\nAuthType Basic\r\nAuthName \u201cLogin Details\u201d\r\nRequire valid-user<\/pre>\n<p>5. Both these files need to be uploaded in the same folder which you want to be secure. Now, if any other user than you tries to access that directory or any files in it, they will be asked for login details. So, your web directory is now secured with the password.<\/p>\n<div style=\"background-color: #e0ffff; padding: 10px;\"><strong>NOTE<\/strong> \u2013 You won\u2019t be able to see these files on your server as they are hidden files. You can view the Filezilla FTP client and check the <strong>\u201cforce showing hidden files\u201d<\/strong> option to view these files. You can also create these files easily in Notepad but save them without .txt extension (Save a type \u2013 select <strong>\u201cAll Files\u201d<\/strong>, then you can save without any extension). In case the Login window keeps popping up, it indicates that your login details are wrong.<\/div>\n<div><\/div>\n<div>That&#8217;s it! You have now learned to enable password protection for .htaccess.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>The article reveals the steps to enable .htaccess password protection. 1. Firstly, create an .htpasswd file with your own username and password in any text editor and save it without the .txt extension. Encrypt the password for extra protection. 2. After visiting the link, just enter the username and password. This will generate the code [&hellip;]<\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[649,608,712],"class_list":["post-5571","post","type-post","status-publish","format-standard","placeholder-for-hentry","category-cpanel-faq","tag-htaccess","tag-htaccess-file","tag-password-protect-htaccess"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Learn to Enable .htaccess Password Protection with these Simple Steps<\/title>\n<meta name=\"description\" content=\"It is possible to protect your .htaccess file with password. The article displays simple steps to password protect your .htacess.\" \/>\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.milesweb.co.uk\/hosting-faqs\/enable-password-protection-for-htaccess\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Learn to Enable .htaccess Password Protection with these Simple Steps\" \/>\n<meta property=\"og:description\" content=\"It is possible to protect your .htaccess file with password. The article displays simple steps to password protect your .htacess.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/enable-password-protection-for-htaccess\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"article:published_time\" content=\"2019-05-31T08:45:05+00:00\" \/>\n<meta name=\"author\" content=\"Pallavi Godse\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Pallavi Godse\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/enable-password-protection-for-htaccess\/\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/enable-password-protection-for-htaccess\/\",\"name\":\"Learn to Enable .htaccess Password Protection with these Simple Steps\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website\"},\"datePublished\":\"2019-05-31T08:45:05+00:00\",\"author\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945\"},\"description\":\"It is possible to protect your .htaccess file with password. The article displays simple steps to password protect your .htacess.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/enable-password-protection-for-htaccess\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/enable-password-protection-for-htaccess\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/enable-password-protection-for-htaccess\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Steps to Enable Password Protection for .htaccess?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/\",\"name\":\"Web Hosting FAQs by MilesWeb\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945\",\"name\":\"Pallavi Godse\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/eefc9695ea2b2c6e143c9c9919701aaa?s=96&d=blank&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/eefc9695ea2b2c6e143c9c9919701aaa?s=96&d=blank&r=g\",\"caption\":\"Pallavi Godse\"},\"description\":\"Pallavi is a Digital Marketing Executive at MilesWeb and has an experience of over 4 years in content development. She is interested in writing engaging content on business, technology, web hosting and other topics related to information technology.\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/author\/pallavi\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Learn to Enable .htaccess Password Protection with these Simple Steps","description":"It is possible to protect your .htaccess file with password. The article displays simple steps to password protect your .htacess.","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.milesweb.co.uk\/hosting-faqs\/enable-password-protection-for-htaccess\/","og_locale":"en_GB","og_type":"article","og_title":"Learn to Enable .htaccess Password Protection with these Simple Steps","og_description":"It is possible to protect your .htaccess file with password. The article displays simple steps to password protect your .htacess.","og_url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/enable-password-protection-for-htaccess\/","og_site_name":"Web Hosting FAQs by MilesWeb","article_published_time":"2019-05-31T08:45:05+00:00","author":"Pallavi Godse","twitter_misc":{"Written by":"Pallavi Godse","Estimated reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/enable-password-protection-for-htaccess\/","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/enable-password-protection-for-htaccess\/","name":"Learn to Enable .htaccess Password Protection with these Simple Steps","isPartOf":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website"},"datePublished":"2019-05-31T08:45:05+00:00","author":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945"},"description":"It is possible to protect your .htaccess file with password. The article displays simple steps to password protect your .htacess.","breadcrumb":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/enable-password-protection-for-htaccess\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.co.uk\/hosting-faqs\/enable-password-protection-for-htaccess\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/enable-password-protection-for-htaccess\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/"},{"@type":"ListItem","position":2,"name":"Steps to Enable Password Protection for .htaccess?"}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/","name":"Web Hosting FAQs by MilesWeb","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Person","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945","name":"Pallavi Godse","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/eefc9695ea2b2c6e143c9c9919701aaa?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/eefc9695ea2b2c6e143c9c9919701aaa?s=96&d=blank&r=g","caption":"Pallavi Godse"},"description":"Pallavi is a Digital Marketing Executive at MilesWeb and has an experience of over 4 years in content development. She is interested in writing engaging content on business, technology, web hosting and other topics related to information technology.","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/author\/pallavi\/"}]}},"views":621,"_links":{"self":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/5571","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/comments?post=5571"}],"version-history":[{"count":1,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/5571\/revisions"}],"predecessor-version":[{"id":5572,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/5571\/revisions\/5572"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/media?parent=5571"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/categories?post=5571"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/tags?post=5571"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}