{"id":439,"date":"2012-08-03T15:40:11","date_gmt":"2012-08-03T15:40:11","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2012\/08\/03\/password-single-file-htaccess\/"},"modified":"2021-08-16T23:38:10","modified_gmt":"2021-08-17T03:38:10","slug":"password-single-file-htaccess","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/website\/password-single-file-htaccess\/","title":{"rendered":"How to password protect a single file with htaccess"},"content":{"rendered":"<p>The .htaccess file is a powerful tool where many behind the scene things are handled. In addition to things such as forcing a specific url formatting, it can also help with access to certain pages. Many sites have members only areas of their websites. These are either coded to check against a database with languages such as php, or grouped together into a single subfolder that is password protected via the cPanel.<\/p>\n<p>There are times, however, when you may only want to password protect a single page that is in an otherwise public folder. Perhaps the program you built your site with does not create subfolders, such as the Premium Website Builder, and moving a file to a protected area would break the links on the site. This is where the htaccess file can help. Follow the instructions below as we guide you through password protecting a single file via your htaccess file.<\/p>\n<h2>Password protecting a single file on your website:<\/h2>\n<ol class=\"article_list\">\n<li>First we want to create a username and an encoded password that we will use for the login. This is not done directly in the cpanel, but from a site on the web that can encode the word you want to use as your password. There are many sites that have scripts to do this.<\/li>\n<li>From the site link, copy and paste the code it gives you to a text editor as you will need it later. For reference, the format of the code it gives you is <em>username:encoded_password<\/em>.<\/li>\n<li>Next, you want to <a href=\"\/support\/edu\/cpanel\/how-to-log-into-cpanel\/\">log into your cPanel<\/a>.<\/li>\n<li>Find the <strong>Files<\/strong> category and click on the <strong>File Manager<\/strong> icon.<br>\n<a href=\"\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_01-click-file-manager.png\" rel=\"lightbox-0\"><img decoding=\"async\" width=\"1024\" height=\"195\" src=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_01-click-file-manager-1024x195.png\" class=\"optimized-lcp-image\" alt=\"cpanel\" loading=\"eager\" fetchpriority=\"high\" sizes=\"(max-width: 768px) 100vw, 768px\" srcset=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_01-click-file-manager-1024x195.png 1024w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_01-click-file-manager-300x57.png 300w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_01-click-file-manager-768x146.png 768w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_01-click-file-manager.png 1037w\"><\/a>\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li>You are now in the home directory of the hosting account. The home directory is not accessible from the web via a URL, so it is more secure. We want to create a password file here that will be used to check access for users trying to get to the file we are going to protect. You will want to create a new text file. To do so, find the <strong>New File<\/strong> icon from the top menu bar and click it.<br>\n<a href=\"\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_02-new-file.png\" rel=\"lightbox-0\"><img loading=\"lazy\" decoding=\"async\" class=\"std_ss size-full wp-image-5567\" src=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_02-new-file.png\" alt=\"cpanel-new-file\" width=\"1471\" height=\"603\" srcset=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_02-new-file.png 1471w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_02-new-file-300x123.png 300w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_02-new-file-768x315.png 768w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_02-new-file-1024x420.png 1024w\" sizes=\"auto, (min-width: 1360px) 876px, (min-width: 960px) calc(61.58vw + 51px), calc(100vw - 80px)\" \/><\/a>\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li>A popup will appear, asking to name the file. Here we named it <em>.htpassword<\/em> (Note that the filename begins with a period. This is intentional as it makes the file hidden.) Below that is a field to enter a path to store the file. Leave it blank so it will default to the root folder. Click on <strong>Create New File<\/strong> to continue.<br>\n<a href=\"\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_03-name-file.png\" rel=\"lightbox-0\"><img loading=\"lazy\" decoding=\"async\" class=\"std_ss size-full wp-image-5568\" src=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_03-name-file.png\" alt=\"name-password-file\" width=\"506\" height=\"256\" srcset=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_03-name-file.png 506w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_03-name-file-300x152.png 300w\" sizes=\"auto, (min-width: 1360px) 876px, (min-width: 960px) calc(61.58vw + 51px), calc(100vw - 80px)\" \/><\/a>\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li>From here, click on the <strong>Settings<\/strong> button in the upper right corner.<br>\n<a href=\"\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_04-click-settings.png\" rel=\"lightbox-0\"><img loading=\"lazy\" decoding=\"async\" class=\"std_ss size-full wp-image-5569\" src=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_04-click-settings.png\" alt=\"name-password-file\" width=\"1149\" height=\"633\" srcset=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_04-click-settings.png 1149w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_04-click-settings-300x165.png 300w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_04-click-settings-768x423.png 768w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_04-click-settings-1024x564.png 1024w\" sizes=\"auto, (min-width: 1360px) 876px, (min-width: 960px) calc(61.58vw + 51px), calc(100vw - 80px)\" \/><\/a>\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li>Click on the <strong>Show Hidden Files<\/strong> checkbox and then click <strong>Save<\/strong>.<br>\n<a href=\"\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_05-show-hidden.png\" rel=\"lightbox-0\"><img loading=\"lazy\" decoding=\"async\" class=\"std_ss size-full wp-image-5570\" src=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_05-show-hidden.png\" alt=\"name-password-file\" width=\"508\" height=\"346\" srcset=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_05-show-hidden.png 508w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_05-show-hidden-300x204.png 300w\" sizes=\"auto, (min-width: 1360px) 876px, (min-width: 960px) calc(61.58vw + 51px), calc(100vw - 80px)\" \/><\/a>\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li>The new file is now in your account. In the right hand pane, scroll down until you find the file, then right click on it. Click on the <strong>Edit<\/strong> option from the menu that appears. A popup will appear, simply click on the <strong>Edit<\/strong> button in the lower right to continue.<br>\n<a href=\"\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_06-click-edit.png\" rel=\"lightbox-0\"><img loading=\"lazy\" decoding=\"async\" class=\"std_ss size-full wp-image-5571\" src=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_06-click-edit.png\" alt=\"find-htpassword\" width=\"1120\" height=\"908\" srcset=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_06-click-edit.png 1120w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_06-click-edit-300x243.png 300w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_06-click-edit-768x623.png 768w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_06-click-edit-1024x830.png 1024w\" sizes=\"auto, (min-width: 1360px) 876px, (min-width: 960px) calc(61.58vw + 51px), calc(100vw - 80px)\" \/><\/a>\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li>We are now in the editor. Cut and paste the username and password code you were given before. Keep the code as a single line and do not edit it. Click on the <strong>Save Changes<\/strong> button to save the file.<br>\n<a href=\"\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_07-click-edit.png\" rel=\"lightbox-0\"><img loading=\"lazy\" decoding=\"async\" class=\"std_ss size-full wp-image-5572\" src=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_07-click-edit.png\" alt=\"save-htpassword\" width=\"504\" height=\"347\" srcset=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_07-click-edit.png 504w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_07-click-edit-300x207.png 300w\" sizes=\"auto, (min-width: 1360px) 876px, (min-width: 960px) calc(61.58vw + 51px), calc(100vw - 80px)\" \/><\/a>\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li>Now, we want to move to the root folder for your domain and alter the .htaccess file so that visitors are challenged with the login prompt. If you are working with the primary domain, double click on the <em>public_html<\/em> folder to enter. For addon domains, double click on the <em>public_html<\/em> folder and then find the subfolder that is the root for the domain and double click that one to enter its root. For our example, we are using the primary domain. Locate the <em>.htaccess<\/em> file and right click it as you did before with your password file. This also brings up a menu. Find and click on the <strong>Edit <\/strong>option. If you get a popup box, simply find and click the <strong>Edit <\/strong>button in the lower right corner to continue to the editor.<\/li>\n<li>You are now in the text editor for the <em>.htaccess<\/em> file. Place the following code into your htaccess so that it prompts the visitor for a login.\n<div class=\"code_block\">AuthUserFile \/home\/user\/.htpassword<br>\nAuthName \u201cname of login prompt\u201d<br>\nAuthType basic<br>\n&lt;files pagename&gt;<br>\nrequire valid-user<br>\n&lt;\/files&gt;<\/div>\n<p class=\"alert\">The pagename should be the exact page in that directory, not an absolute path.<br>\nFor example: \/home\/user\/public_html\/wp-login.php would just have wp-login.php in the .htaccess file in that directory.<\/p>\n<\/li>\n<li>Before you save it, there are a few items to change. First, change \u2018<em>\/path\/to\/htpasswd\/file\/.htpassword<\/em>\u2018 to the actual path to your .htpassword file. For example, your path would look like <em>\/home\/username\/.htpassword<\/em> (be sure to replace \u2018username\u2019 with your real cpanel username.)<\/li>\n<li>Second, change the AuthName to something meanignful. This is the title of the login prompt.<\/li>\n<li>Third, the file name needs to reflect the name of the page you are protecting. Change \u2018<em>mypage.html<\/em>\u2018 to the actual file name.<br>\n<a href=\"\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_Password_Single_File_save-htaccess.png\" rel=\"lightbox-0\"><img loading=\"lazy\" decoding=\"async\" class=\"std_ss size-full wp-image-5573\" src=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_Password_Single_File_save-htaccess.png\" alt=\"save-htaccess\" width=\"729\" height=\"283\" srcset=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_Password_Single_File_save-htaccess.png 729w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_Password_Single_File_save-htaccess-300x116.png 300w\" sizes=\"auto, (min-width: 1360px) 876px, (min-width: 960px) calc(61.58vw + 51px), calc(100vw - 80px)\" \/><\/a>\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li>Click on the <strong>Save Changes<\/strong> button at the top to save the file.<\/li>\n<li>Visit the page on your site to ensure that it is asking for the login. Once you log in, the site will likely not ask again when you return as the browser remembers your previous visit.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>The .htaccess file is a powerful tool where many behind the scene things are handled. In addition to things such as forcing a specific url formatting, it can also help with access to certain pages. Many sites have members only areas of their websites. These are either coded to check against a database with languages<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/website\/password-single-file-htaccess\/\"> Read More ><\/a><\/p>\n","protected":false},"author":8,"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":[4299,4288],"tags":[],"class_list":["post-439","post","type-post","status-publish","format-standard","hentry","category-security","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 password protect a single file with htaccess | InMotion Hosting<\/title>\n<meta name=\"description\" content=\"Learn how to password protect a single file on your account via the 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\/password-single-file-htaccess\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to password protect a single file with htaccess | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"Learn how to password protect a single file on your account via the htaccess.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/website\/password-single-file-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=\"2012-08-03T15:40:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-17T03:38:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_01-click-file-manager.png\" \/>\n<meta name=\"author\" content=\"Scott Mitchell\" \/>\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=\"Scott Mitchell\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/password-single-file-htaccess\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/password-single-file-htaccess\/\"},\"author\":{\"name\":\"Scott Mitchell\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/d850efb28ef3573db7d24b0d8fa9eaed\"},\"headline\":\"How to password protect a single file with htaccess\",\"datePublished\":\"2012-08-03T15:40:11+00:00\",\"dateModified\":\"2021-08-17T03:38:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/password-single-file-htaccess\/\"},\"wordCount\":886,\"commentCount\":12,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/password-single-file-htaccess\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_01-click-file-manager.png\",\"articleSection\":[\"Security\",\"Website\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/website\/password-single-file-htaccess\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/password-single-file-htaccess\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/website\/password-single-file-htaccess\/\",\"name\":\"How to password protect a single file with htaccess | InMotion Hosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/password-single-file-htaccess\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/password-single-file-htaccess\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_01-click-file-manager.png\",\"datePublished\":\"2012-08-03T15:40:11+00:00\",\"dateModified\":\"2021-08-17T03:38:10+00:00\",\"description\":\"Learn how to password protect a single file on your account via the htaccess.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/password-single-file-htaccess\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/website\/password-single-file-htaccess\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/password-single-file-htaccess\/#primaryimage\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_01-click-file-manager.png\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_01-click-file-manager.png\",\"width\":1037,\"height\":197,\"caption\":\"cpanel\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/password-single-file-htaccess\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to password protect a single file 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\/d850efb28ef3573db7d24b0d8fa9eaed\",\"name\":\"Scott Mitchell\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/scott\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to password protect a single file with htaccess | InMotion Hosting","description":"Learn how to password protect a single file on your account via the 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\/password-single-file-htaccess\/","og_locale":"en_US","og_type":"article","og_title":"How to password protect a single file with htaccess | InMotion Hosting","og_description":"Learn how to password protect a single file on your account via the htaccess.","og_url":"https:\/\/www.inmotionhosting.com\/support\/website\/password-single-file-htaccess\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2012-08-03T15:40:11+00:00","article_modified_time":"2021-08-17T03:38:10+00:00","og_image":[{"url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_01-click-file-manager.png","type":"","width":"","height":""}],"author":"Scott Mitchell","twitter_card":"summary_large_image","twitter_creator":"@InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"Scott Mitchell","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/password-single-file-htaccess\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/password-single-file-htaccess\/"},"author":{"name":"Scott Mitchell","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/d850efb28ef3573db7d24b0d8fa9eaed"},"headline":"How to password protect a single file with htaccess","datePublished":"2012-08-03T15:40:11+00:00","dateModified":"2021-08-17T03:38:10+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/password-single-file-htaccess\/"},"wordCount":886,"commentCount":12,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/password-single-file-htaccess\/#primaryimage"},"thumbnailUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_01-click-file-manager.png","articleSection":["Security","Website"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/website\/password-single-file-htaccess\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/password-single-file-htaccess\/","url":"https:\/\/www.inmotionhosting.com\/support\/website\/password-single-file-htaccess\/","name":"How to password protect a single file with htaccess | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/password-single-file-htaccess\/#primaryimage"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/password-single-file-htaccess\/#primaryimage"},"thumbnailUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_01-click-file-manager.png","datePublished":"2012-08-03T15:40:11+00:00","dateModified":"2021-08-17T03:38:10+00:00","description":"Learn how to password protect a single file on your account via the htaccess.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/password-single-file-htaccess\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/website\/password-single-file-htaccess\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/password-single-file-htaccess\/#primaryimage","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_01-click-file-manager.png","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2012\/08\/edu_htaccess_01-click-file-manager.png","width":1037,"height":197,"caption":"cpanel"},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/password-single-file-htaccess\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"How to password protect a single file 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\/d850efb28ef3573db7d24b0d8fa9eaed","name":"Scott Mitchell","url":"https:\/\/www.inmotionhosting.com\/support\/author\/scott\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":null,"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/439","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\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=439"}],"version-history":[{"count":3,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/439\/revisions"}],"predecessor-version":[{"id":85746,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/439\/revisions\/85746"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=439"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=439"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=439"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}