What Is .htaccess?
.ht access The big
mystery
A file that starts with a period and is considered
invisible. The truth is you can start any Unix or Linux server
file name with a period and it will become “invisible” to
anyone without the proper permissions. The other truth is
.htaccess is nothing more than a text file with a special
name.
That’s right, you can use a simple text editor and save the
file as .htaccess, upload it to your web host, and if the text
is correct (which is easy to do) you will have a simple text
file that does magical things.
Granted, there are a lot of very technical, complicated, and
downright convoluted, things you can do with the .htaccess
file. But you don’t have to. And with this example you’ll see
just how simple it is to make the magic happen.
The One File, One Line Of Text, Cloaking
Method
This method allows you to use a single text file, the
.htaccess file, to redirect any friendly file you want to
anywhere you want with one line of text. There is only one
exception, if the friendly URL points to a file or directory
that really exists on your web site.
This is a good thing because it means you can implement this
link cloaking method on any site at any time.
I want you to let that last paragraph sink
in.
It really means you can make up links to URLs that don’t
really exist, anywhere, and have them go anywhere you want and
still have your affiliate ID properly tracked. And you can do
it with one line of text.
So let’s get to it. First, here is the barebones .htaccess
file (this is what you will find in the .htaccess file
that came with this e-Book):
# BEGIN
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
</IfModule>
# END
|