RSS Directory

Anyone who has tampered around with web design has probably heard of htaccess, even if they are not totally familiar with what it is, or what it can do. The fact is, every single website owner should know what htaccess is, be familiar with its functionality, and USE IT!

This article will give you a brief introduction to what htaccess is, and teach you how by using it, you can make your website more secure, improve your search engine rankings, and give your website a more professional image.

.htaccess- What Is It?

Wikipedia’s definition for .htaccess is as follows:

“.htaccess (Hypertext Access) is the default name of Apache’s directory-level configuration file. It provides the ability to customize configuration directives defined in the main configuration file. The configuration directives need to be in .htaccess context and the user needs appropriate permissions.”

.htaccess is a simple ASCII file, which you can create using a text editor such as Notepad. Many people get confused as to how the file should be named. The important thing to know is that .htaccess is the file extension, not the name. You notice that nothing appears before the period (.)- not file.htaccess, pagename.htaccess, but just .htaccess.

Because htaccess is handled by Apache and not NT, they will only work on web servers running Apache. If your web hosting is done on a Linux server, you’ll be fine.

Creating an .htaccess File

Before I go in to this, I must mention that some web hosts (mostly free web hosting providers) may not allow you to use htaccess files. Be sure you are able to use htaccess files so that you don’t get into trouble with your web host and get your account suspended. If you already have an htaccess file on your site, you should be fine. Also, I am writing this article as a tutorial and don’t accept any responsibility for anything that happens if you goof something up, or if you run into any problems! Your htaccess file can do a lot of good, but it can do a lot of damage as well, and I don’t want to be responsible for that!

First, you can login to your website using your FTP program. I will not go into the specifics of FTP, as this is beyond the scope of this article. We’ll assume you know this much already. Browse to the root folder of your website, many times named “public_html”. If you don’t see a file named “.htaccess” already, all you have to do is open up a text editor such as Notepad (In Windows, click Start > Run > type “notepad” > OK). Save the blank file as .htaccess, making sure not to leave a .txt or any other extension at the end of the name. Upload the file to your public_html folder in ASCII mode (NOT binary). If you don’t know what I’m talking about don’t worry- most FTP programs will automatically select the correct upload mode. Be sure that the permissions, or attributes for this file are set to 644 (RW-R–R–), to prevent other people from having access to this file.

Congratulations! You’ve just created your .htaccess file!

NOTE: If using FrontPage extensions for your website, you can not edit the .htaccess file without ruining your FrontPage extensions. ONLY modify your .htaccess file if you ARE NOT using FrontPage extensions on your website.

Working With htaccess

Now that you’ve got the file on your site, you’re ready to begin. If you already had an .htaccess file, you can add what you’d like on to it.

This is the end of part 1 of our .htaccess tutorial. Part 2 will walk you through some of the functionality of your .htaccess file.

Category: Tutorials
Article posted by: Neon on July 12th, 2007

Trackback URI | Comments RSS

3 Comments to “.HTACCESS- Your New Best Friend (Part 1)” »

Jul 16 2007 at 10:50 am

[…] is the last in a three part htaccess tutorial. Feel free to review part 1 and part 2 before […]

(Comments wont nest below this level)
Jul 21 2007 at 4:09 pm

[…] are topics that interest you.He has recently written a small series of posts on the infamous .htaccess file that is highly informative and […]

(Comments wont nest below this level)
Oct 06 2007 at 11:15 am

[…] you didn’t catch part 1, which is an introduction to htaccess, read that post […]

(Comments wont nest below this level)
Name (required)
E-mail (required - never shown publicly)
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> in your comment.

© 2023 c/o Neon.