
Control Web Server - Use the Htaccess FilePosted February 21st, 2010Even the best website with fantastic design is far from a perfect system if you don’t take care for security, redirection of www subdomain, error pages, etc. Many web servers including Apache support the .htaccess file which is a configuration file for web server configuration. This file can be used to tighten the security of the website, to password protect certain directories, to redirect old deleted pages to new addresses or to modify almost any web server setting. The .htaccess web server configuration file is well documented on many web pages–when you will need exact instructions on how to do something simply Google for it. You only need to know what is possible to do with this file. Authorization and Authentication Rewriting URLs Another use of rewriting is also to redirect www address to non-www address or vice versa. For historical reasons when web emerged all the websites used the www subdomain. There is no need to use it, but majority of sites still uses this kind of web address. And because some users type it and some don’t, you have to take care for both variants. The easiest way to redirect one address to another is by using the .htaccess configuration file. IP Address Blocking Directory Listing Custom Error Pages .htaccess file provides a powerful control over the web server. It can secure your website but it can also make it inaccessible. Make sure you have a backup copy before you change settings. If you have a website without the this file you are probably satisfied because the site works fine and you are not missing anything. But do you have a www to non-www redirection and nice error pages? The author uses .htaccess file for every website he creates. For example, the http://revellmodelkits.com/ site is also accessible with the redirection is done with the .htaccess file. The rewriting function is also used to create short and meaningful addresses of each page like http://revellmodelkits.com/revell-model-airplanes for example. Using .htaccess is simple. All the settings are well documented and easy to understand. However, in some cases you will need to understand also regular expressions which can be tricky. In the case of questions or problems you should ask Google first.
![]() ![]() |
![]() ![]() ![]() ![]() ![]() ![]() |
