What is htaccess?
Hypertext Access, commonly shortened to htaccess, is a configuration file which controls the directory it is placed in and all the subdirectories underneath it. It’s an incredibly useful feature which allows webmasters to control how many aspects of their website works. You can redirect pages, change the extensions of pages, password protect directories and much much more.
In this htaccess guide I will show you some of the basic tricks and tips which will help you with your website.
So what is htaccess?
The htaccess file is a configuration file which is used on Apache based web servers to control many features of the server. The file itself is just a small basic text file and can be edited via your hosts file manager or alternatively you can download the file, edit it and reupload it.
If you have installed a script before then chances are you have had to edit the .htaccess file at one point or another. The .htaccess file gives you a lot of control and lets you easily redirect pages, password protect directories and much more. Before I go through some tutorials which show you how to use htaccess, I think it is necessary to show you how you edit the file.
Where is the .htaccess file?
The first thing you need to do is find out if your host actually lets you edit htaccess files. Because of security problems which can arise, many hosts stop their customers from editing it the .htaccess file. Therefore you should check the Frequently Asked Questions area of your host to see if you have permission to edit the file (failing that, email them).
Some operating systems may not show the .htaccess file on your computer so you may need to make sure settings show hidden files as well. Likewise some FTP Clients will not show the .htaccess file when you connect to your host so you need to make sure that your FTP is set up to show hidden files too (I personally use FileZilla and that shows .htaccess by default).
Better safe than sorry
The .htaccess gives you a lot of control over what happens on your site but accidents do happen so make sure you keep a backup or best create a copy of the htacess file of the last working .htaccess file you used before attempting to modify it in anyway. This way you can recover quickly from a site crash!
Htaccess is also extremely sensitive. A missing semi colon, incorrect letter or an extra backslash can mess everything up so you need to make sure that what you enter is correct 100%. Don’t let this scare you off though, as long as you take your time and make sure everything is input correctly you can enter just a few lines to htaccess to achieve things which most php scripts take a page to do.
To learn more about htaccess simply click on one of the articles at the right hand side. Good luck