Tuesday, April 14, 2009

Htaccess: Introduction

Introduction to .htaccess

If you are hosting your site on a shared server (virtual hosting), then you don´t have access to the basic configuration of the servers on which your websites are hosted. But there are certain functions which require a different server configuration, so there is the possibility for you to override the default server configuration using certain commands in the so-called .htaccess file. ".htaccess" is a Unix file format and can only be used on linux (apache) servers.

Some examples of what can be done with a .htaccess file. They are all covered in this tutorial:

  • Define custom error pages
  • Banning certain IP addresses from accessing your site
  • redirecting users to other pages / sites
  • password protecting directories
  • enabling certain PHP modules
  • enabling SSI (server side includes)

Please note that not all webhosts allow their users to use .htaccess files, so if you are unsure it would be good to ask your host if they do or simply check their support forum / knowledge base for discussions about how to use .htaccess files.

How to create .htaccess files

Creating a .htaccess file is very easy and can be done with any ASCII text editor like textpad or notepad. I´ve noticed that many people are confused about the strange filename. Well - actually this file doesn´t even have a name at all, it´s just a long file name extension - .htaccess. Hence, the DOT before "htaccess" is NOT a typo.

To create a .htaccess file, simply open a new blank document in your favorite text editor and save the file as .htaccess. Some text editors (like notepad) do not support the Unix file format and therefore you won´t be able to save a file with the ".htaccess" extension only. In this case you can simply save the file as 1.htaccess or htaccess.txt and later (after you have uploaded it to your server) rename it to .htaccess through your FTP client.





This article was taken from: easywebtutorial

0 SHARE UR COMMENTS:

Post a Comment

Translate This Page

 
© Copyright by Conscious Change9  |  Template by Blogspot tutorial