|
|
.htaccessWhat is .htaccess? An .htaccess file is a simple ASCII file, which means you may use notepad to create it. It's used in a directory to change the server configuration. It affects the directory where its in AND all directories under it. So placing it in the root affects all directories in your website, but placing it in the directory called images only affects that directory and any under it. Usually its part of the Apache Web Server, the most common today. When you buy hosting, your assigned server has some defaults assigned to it. These defaults may or may not work with your idea of perfect. Thats where the .htaccess file comes into play. It's a powerful configuration file, using it wrong may open holes in security, but using right may turn on or off features in your webserver. Some of the most common features you can do with .htaccess are change your 404 file (the file you see when no page is found), allowing or disallowing access to your site, making odd URLs look better, hotlink prevention and many more. Some may get very complex, others are simple to make. How do I create an .htaccess file? To create it, open notepad, and save the empty file as .htaccess or you may have to save it as "htaccess.txt". You will have to remove the .txt from the file and add a period in front of it such as ".htaccess". If your operating system (your windows) doesnt let you thats fine, we can rename it later in your FTP program or once its uploaded. Once done creating the file, open your FTP program. Login to your hosting account and upload the htaccess file into the desired folder (usually its your root folder). Please upload it in text or ASCII mode. Binary won't work. The .htaccess is a configuration or reconfiguration file, so you have to be careful on how your manage it. One good thing is that if you upload it wrong or type something wrong in it and your server "breaks" you can just rename it or delete it and everything works again... But be careful anyway. Here is a list of the most common usage of .htaccess:
|
|||||||||||||||||||
|
||||||||||