Hide Your .htaccess Settings Using … .htaccess

By  on  

Your .htaccess file can hold a good amount of information about the structure of your website, some of which should not be exposed to users. These settings include mod_rewrite settings, php_flag/php_value settings, and SetHandler directives.

Luckily, you can use your .htaccess file to hide your .htaccess file. Here's how:

The Code

<files .htaccess>
order allow,deny
deny from all
</files>

Recent Features

  • By
    6 Things You Didn&#8217;t Know About Firefox OS

    Firefox OS is all over the tech news and for good reason:  Mozilla's finally given web developers the platform that they need to create apps the way they've been creating them for years -- with CSS, HTML, and JavaScript.  Firefox OS has been rapidly improving...

  • By
    Create a CSS Cube

    CSS cubes really showcase what CSS has become over the years, evolving from simple color and dimension directives to a language capable of creating deep, creative visuals.  Add animation and you've got something really neat.  Unfortunately each CSS cube tutorial I've read is a bit...

Incredible Demos

Discussion

  1. A better way from the askapache.com htaccess tutorial technically is:

    Order allow,deny
    Deny from all
    

Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!