Thursday, January 15, 2009

.htaccess tips and tricks

http://corz.org/serv/tricks/htaccess.php

For the more technically savvy, there are cool ways to prevent unwanted eyes browsing your content. The .htaccess file resides inside each directory on your server and dictates certain features on how that directory (or your main site) is handled. This file will let you restrict access using various features, to prevent some from viewing the content, but allowing others.

Why is this important? If you are a writer, graphic designer, webmaster, or simply want to share some sort of design or content with a remote third party, you can get into trouble for copyright infringements. Most often, rights are granted to use images or text in the context of a "comp" (something that is intended for review during development, but not for production). Some Bad Companies will say this is a copyright infringement regardless of your intent or even your technical rights, because they want to make money from your fear.

.htaccess files are one avenue of preventing unwanted eyes, or at least limiting access to the intended audience. It's not for those who fear technology or writing even little chunks of code-like text.

introduction to .htaccess

This work in constant progress is some collected wisdom, stuff I've learned on the topic of .htaccess hacking, commands I've used successfully in the past, on a variety of server setups, and in most cases still do. You may have to tweak the examples some to get the desired result, though, and a reliable test server is a powerful ally, preferably one with a very similar setup to your "live" server. Okay, to begin..

There's a good reason why you won't see .htaccess files on the web; almost every web server in the world is configured to ignore them, by default. Same goes for most operating systems. Mainly it's the dot "." at the start, you see?

If you don't see, you'll need to disable your operating system's invisible file functions, or use a text editor that allows you to open hidden files, something like bbedit on the Mac platform. On windows, showing invisibles in explorer should allow any text editor to open them, and most decent editors to save them too**. Linux dudes know how to find them without any help from me.

No comments:

Post a Comment