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
    CSS @supports

    Feature detection via JavaScript is a client side best practice and for all the right reasons, but unfortunately that same functionality hasn't been available within CSS.  What we end up doing is repeating the same properties multiple times with each browser prefix.  Yuck.  Another thing we...

  • By
    Create a CSS Flipping Animation

    CSS animations are a lot of fun; the beauty of them is that through many simple properties, you can create anything from an elegant fade in to a WTF-Pixar-would-be-proud effect. One CSS effect somewhere in between is the CSS flip effect, whereby there's...

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!