.htaccess on Linux servers What is the .htaccess file? The .htaccess file allows customised configuration settings to be applied to a specific directory (and any subdirectories thereof) on a Linux webserver. The .htaccess file described in this article relates to Linux servers only, and should not be confused with the file of the same name created by FrontPage Extensions on a Windows server. For general rules, place the .htaccess file in the /htdocs folder and for any rules specific to a sub-directory under the directory itself e.g. /htdocs/subfolder. The .htaccess file will allow changes to the following configurations: mod_rewrite mod_rewrite allows you to manipulate URL's to make them more user and search engine friendly. An example of how mod_rewite can be used is to direct all requests to a non-www version of a URL to it's www counterpart. For example, requests to ralphsdomainname.com/test/ would be directed to www.ralphsdomainname.com/test. The .htaccess code to achieve this would be: RewriteBase / RewriteCond %{HTTP_HOST} !^www.ralphsdomainname.com$ [NC] RewriteRule ^(.*)$ http://www.ralphsdomainname.com/$1 [R=301,L] More information regarding the use of this feature can be found in our article: Can I use mod_rewrite on my server? Password Protection It is not possible to add password protection directly by creating a .htaccess file, however this feature can be implemented by creating a SafeZone through the Fasthosts control panel. Custom error pages It is not possible to add custom error pages by creating a .htaccess file, however this feature can be activated through your Fasthosts control panel. All other features of the .htaccess file have been disabled on our shared hosting servers.