{"id":86,"date":"2011-04-05T14:03:04","date_gmt":"2011-04-05T14:03:04","guid":{"rendered":"http:\/\/pixert.com\/blog\/?p=86"},"modified":"2011-08-11T06:06:42","modified_gmt":"2011-08-11T06:06:42","slug":"protect-htaccess-file","status":"publish","type":"post","link":"https:\/\/pixert.com\/blog\/protect-htaccess-file\/","title":{"rendered":"Protect .htaccess file"},"content":{"rendered":"<p><a href=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/lock.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"41\" data-permalink=\"https:\/\/pixert.com\/blog\/ssl-login-for-wordpress\/lock\/\" data-orig-file=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/lock.jpg?fit=660%2C686&amp;ssl=1\" data-orig-size=\"660,686\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"Lock\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/lock.jpg?fit=288%2C300&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/lock.jpg?fit=660%2C686&amp;ssl=1\" class=\"alignright size-thumbnail wp-image-41\" title=\"Lock\" src=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/lock-150x150.jpg?resize=150%2C150\" alt=\"\" width=\"150\" height=\"150\" srcset=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/lock.jpg?resize=150%2C150&amp;ssl=1 150w, https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/lock.jpg?zoom=2&amp;resize=150%2C150&amp;ssl=1 300w, https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/lock.jpg?zoom=3&amp;resize=150%2C150&amp;ssl=1 450w\" sizes=\"auto, (max-width: 150px) 100vw, 150px\" \/><\/a>When avisitor tries to obtain access to .htaccess file, server automatically generates a 403 forbidden error.<br \/>\nHowever, we can apply an extra layer of security to .htaccess<\/p>\n<p>Add the following<\/p>\n<pre class=\"brush: plain; title: Code Block; notranslate\" title=\"Code Block\">\r\n\r\n# Protect the htaccess file\r\n\r\n&lt;Files .htaccess&gt;\r\n\r\nOrder Allow,Deny\r\n\r\nDeny from all\r\n\r\n&lt;\/Files&gt;\r\n\r\n<\/pre>\n<p>Note: htaccess file permissions is 644 (chmod)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When avisitor tries to obtain access to .htaccess file, server automatically generates a 403 forbidden error. However, we can apply an extra layer of security to .htaccess Add the following # Protect the htaccess file &lt;Files .htaccess&gt; Order Allow,Deny Deny from all &lt;\/Files&gt; Note: htaccess file permissions is 644 (chmod)<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[8,13,40,5],"tags":[43,9,15,49,6,7],"class_list":["post-86","post","type-post","status-publish","format-standard","hentry","category-centos","category-cpanel","category-web-apps","category-wordpress","tag-apache","tag-centos-2","tag-cpanel-2","tag-htaccess","tag-wordpress-2","tag-wp"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1pvi1-1o","jetpack-related-posts":[{"id":111,"url":"https:\/\/pixert.com\/blog\/how-to-disable-directory-browsing\/","url_meta":{"origin":86,"position":0},"title":"How to disable directory browsing?","author":"Pixel Insert \/ Pixert","date":"June 3, 2011","format":false,"excerpt":"One of the must do on setting a secure Apache webserver is to disable directory browsing. This could prevent the server from showing a listing of the existing files if there's no index in one folder. Disable directory browsing via .htaccess Add in the .htaccess file the following [bash] Options\u2026","rel":"","context":"In &quot;CentOS&quot;","block_context":{"text":"CentOS","link":"https:\/\/pixert.com\/blog\/category\/centos\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/feather-small.gif?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":149,"url":"https:\/\/pixert.com\/blog\/redirect-https-to-http-on-your-site-with-htaccess\/","url_meta":{"origin":86,"position":1},"title":"Redirect https to http on your site with .htaccess","author":"Pixel Insert \/ Pixert","date":"October 19, 2011","format":false,"excerpt":"You can use the following snippet to avoid having duplicate listings in the search engines or when your site showing security errors on your browser [bash] Options +FollowSymlinks RewriteEngine on RewriteCond %{SERVER_PORT} ^443$ RewriteRule ^(.*)$ http:\/\/www.yourdomain.com\/$1 [R=301,L] [\/bash]","rel":"","context":"In &quot;CentOS&quot;","block_context":{"text":"CentOS","link":"https:\/\/pixert.com\/blog\/category\/centos\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/cpanel-logo.gif?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":62,"url":"https:\/\/pixert.com\/blog\/how-to-disable-phpinfo\/","url_meta":{"origin":86,"position":2},"title":"How to disable phpinfo","author":"Pixel Insert \/ Pixert","date":"March 22, 2011","format":false,"excerpt":"The phpinfo() function is a very powerful one, \u00a0you can learn quite a lot about your PHP installation.\u00a0Some server administrators may choose to disable the PHP function phpinfo() for security reasons, because it displays information which can be used to compromise the server that your site is running on. You\u2026","rel":"","context":"In &quot;CentOS&quot;","block_context":{"text":"CentOS","link":"https:\/\/pixert.com\/blog\/category\/centos\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/php.gif?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":78,"url":"https:\/\/pixert.com\/blog\/limiting-access-to-admin-folder-htaccess\/","url_meta":{"origin":86,"position":3},"title":"Limiting Access to Admin folder via .htaccess","author":"Pixel Insert \/ Pixert","date":"March 31, 2011","format":false,"excerpt":"Some CMS have admin folder. It's an important folder because it has all the files that deal with administration. If the security of the files in it is compromised, bad things can happen. One effective option to reducing the risk of a security breach on the Admin folder is by\u2026","rel":"","context":"In &quot;Web Apps&quot;","block_context":{"text":"Web Apps","link":"https:\/\/pixert.com\/blog\/category\/web-apps\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/lock-288x300.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":117,"url":"https:\/\/pixert.com\/blog\/hide-the-apache-web-server-version-number\/","url_meta":{"origin":86,"position":4},"title":"Hide the Apache Web Server Version number","author":"Pixel Insert \/ Pixert","date":"June 6, 2011","format":false,"excerpt":"There are two config directives that controls Apache version. The\u00a0ServerSignature directive adds a line containing the Apache HTTP Server server version and the ServerName to any server-generated documents, such as error messages sent back to clients. The\u00a0ServerTokens directive controls whether Server response header field which is sent back to clients\u2026","rel":"","context":"In &quot;CentOS&quot;","block_context":{"text":"CentOS","link":"https:\/\/pixert.com\/blog\/category\/centos\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/feather-small.gif?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":254,"url":"https:\/\/pixert.com\/blog\/redirect-old-domain-to-new-domain\/","url_meta":{"origin":86,"position":5},"title":"Redirect Old Domain to New Domain","author":"Pixel Insert \/ Pixert","date":"July 14, 2012","format":false,"excerpt":"How to redirect old domain to new domain through .htaccess? You should add this code in .htaccess file Method no 1 [text] Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http:\/\/www.newdomain.com\/$1 [R=301,L] [\/text] Method no 2 [text] Redirect 301 \/ http:\/\/www.newdomain.com\/ [\/text]","rel":"","context":"In &quot;Code Snippet&quot;","block_context":{"text":"Code Snippet","link":"https:\/\/pixert.com\/blog\/category\/code-snippet\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/posts\/86","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/comments?post=86"}],"version-history":[{"count":0,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/posts\/86\/revisions"}],"wp:attachment":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/media?parent=86"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/categories?post=86"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/tags?post=86"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}