|
|
|
What A htaccess File Is And How To Make One
.htaccess file is a done by clicking the file and simple ASCII file similar renaming it by removing anything to that created through that doesn’t say .htaccess. It text editor such as Notepad or can also be renamed via telnet or Simple Text. Most people are the ftp program. confused with the naming convention for the file. The term These files must not be uploaded .htaccess is not a file .htaccess as binary but rather as ASCII or somepage.htaccess because it mode. Users can CHMOP the is the file extension simply .htaccess file to 644 to make the named as such. Its widely known file usable by the server while use is related to implementing preventing it from being read by custom error page or password a browser since this can protected directories. seriously compromise security. When there are passwords Creating the File protected directories and a browser can read the .htaccess The creation of the file is done file, the location of the by opening up a text editor and authentication file can be saving an empty page as acquired to reverse engineer the .htaccess. If it is not allowed list and thereby completely to save an empty page, simply access any portion that had type in one character. An editor previously been protected. This probably appends its default file can be prevented by either extension to the name. Notepad placing all authentication files for one would call the file above root directory thereby .htaccess.txt but the .txt or rendering the www inaccessible or other file extension need to be through an .htaccess series of removed to enable the user to commands that prevents itself start “htaccessing”. This can be from being accessed by a browser.
.htaccess located in the root, if Most commands in .htaccess are considered the nearest, affects meant to be placed on one line every single directory in the only thus if a text editor uses entire site. word wrap, it should be disabled as it is possible that it might Placement of .htaccess should not throw in a few characters that be done indiscriminately as this might contradict Apache. may result to redundancy and may .htaccess is not for NT servers cause an infinite loop of and is considered an Apache redirects or errors. There are thing. Apache is generally very sites that do not allow the use tolerant of malformed content in of .htaccess files because a an .htaccess file. server overloaded with domains can be slowed down when all are The directory in which .htaccess using .htaccess files. It is file is placed is “affected” as possible that .htaccess can well as all sub-directories. It a compromise a server configuration user wishes not to have certain specifically set-up by the .htaccess commands affect a administrator. It is therefore specific directory, this is done necessary to make sure that the by placing a new .htaccess file use of .htaccess is allowed within the directory that should before its actual use. not be affected with certain changes and removing the specific Error documents are only a part command/s. from the new .htaccess of the general use of .htaccess. file which should not affect the Specifying one’s own customized directory. The nearest .htaccess error documents will require a file to the current directory is command within the .htaccess the one considered as the file. The pages can be named .htaccess file. A global anything and can be placed
anywhere within the site as long password protecting folders and as they are web-accessible automatic redirection of users, through a URL. The best names are .htaccess is also capable of those that would prevent the user changing file extension, banning from forgetting what the page is users with extra certain IP being used for. address allowing only users with certain IP addresses, stopping Password protection is directory listing and using a effectively dealt with by different file as the index file. .htaccess. By creating a file Accessing a site that has been called .htpasswd, username and protected by .htaccess will the encrypted password of the require a browser to pop-up a people to be allowed access are standard username/password placed in the .htpasswd file. The display box. However, there are .htpasswd file should likewise be certain scripts available which not uploaded to a directory that will allow the user to embed a is web accessible for maximum username/password box in a security. website to do the authentication. The wide variety of uses of Whole directories of a site can .htaccess facilitates time saving be redirected using the .htaccess options and increased security in file without the need to specify a website. each file. Thus any request made for an old site will be Many hosts support .htaccess but redirected to the new site, with do not publicize it while many the extra information in the URL others have the capability for it added on. This is a very powerful but do not allow their users to feature when used correctly. have an .htaccess file. Generally, a server that runs Aside from custom error pages, UNIX or any version of the Apache
web server will support .htaccess configuration can be effectively although the host may not allow made in a Directory Section in its use. the main server configuration file. When to Use .htaccess Files Two main factors warrant avoiding The .htaccess files should not be the use of .htaccess files – used when there is no access to performance and security. the main server configuration Permitting .htaccess files causes file. Contrary to common belief, a performance hit whether or not user authentication is not always it is actually used, since Apache done in .htaccess files. The will look in every directory for preferred way is to put user such file. The .htaccess file is authentication configuration in also looked into every time a the main server configuration. document is requested. The Apache search will include .htaccess It should be used in situations files in all higher-level where the content provider needs directories to have a full to make configuration changes to complement of directories of the server on a per-directory application. As such, each file basis but does not have root accessed out of the directory access on the server system. results to 4 additional file Individual users can be permitted system accesses even if none was to make these changes in originally present. .htaccess files for themselves if the server administrator is The use of .htaccess permits unwilling to make frequent users to modify server configuration. As a general rule, configuration which may produce the use of .htaccess should be uncontrolled changes. This avoided when possible since privilege should be carefully
considered before it is given to by setting the Allow Overide users. The use of the .htaccess directive to none. files can be completely disabled
About the Author:
http://www.theinternetone.net
Read more articles by: Danny Wirken
Article Source: www.iSnare.com |
|