dot pictureservices picturedot picturesupport picture
dot picturecontact picturedot pictureabout picture
dot picturehome picture





Today's Discussion
Create New Topic
List by Topic


Excite Search
Atomz Search:

Advanced Atomz

.htaccess Modifications

We do not offer support for .htaccess modifications. The following examples will work on our systems and we offer them as a courtesy to our customers. Complete documentation on mod_rewrite at  

FRONTPAGE WARNING: Any modifications to your .htaccess file can corrupt your extensions and render your site inaccessible. A backup copy of your .htaccess file should be made before you attempt any changes.

The .htaccess file is an ASCII text document that can be placed in any directory on your site. It can be used to control access to files and directories, and customize some server operation in your site. A .htaccess file can be created in any word processor but must be saved as text only. You must use FTP software in ASCII mode to upload or edit your .htaccess file. For the examples provided here, place the .htaccess file in your root directory.

FRONTPAGE WARNING: FrontPage sites have a .htaccess file in the root directory that is created when the FrontPage extensions are installed. FrontPage users should proceed with caution and make a backup copy of their .htaccess file before making any changes. Incorrect changes to your .htaccess file can result in your site being unreachable.


Custom Error Messages

Add the following to the .htaccess file::

ErrorDocument 404 /notfound.html

After "ErrorDocument" specify the error code, followed by a space, and then the path and filename of the .html file you would like to be displayed when the specified error is generated.


Denying User Access

Add the following to the .htaccess file:

<Limit GET>
order allow,deny
deny from 128.23.45.
deny from
allow from all

This is an example of a .htaccess file that will block access to your site to anyone who is coming from any IP address beginning with 128.23.45 and from the specific IP address . By specifying only part of an IP address, and ending the partial IP address with a period, all sub-addresses coming from the specified IP address block will be blocked. You must use the IP addresses to block access, use of domain names is not supported.


Redirect a Machine Name

FRONTPAGE WARNING: Adding this to your .htaccess will not allow you to publish with FrontPage. You need to keep a copy of your original .htaccess file to replace the modified file when making changes to the site

Add the following to the .htaccess file:

RewriteEngine On
Options +FollowSymlinks
RewriteBase /
# Rewrite Rule for
RewriteCond %{HTTP_HOST}$
RewriteCond %{REQUEST_URI} !machine/
RewriteRule ^(.*)$ machine/$1

This will redirect requests for the machine name to the directory machine on the site .


Different Default Home Page

Add the following to the .htaccess file:

DirectoryIndex filename.html

Then a request for would return if it exists, or would list the directory if it did not exist.

To automatically run a cgi script, add the following to the .htaccess file:

DirectoryIndex /cgi-local/

This would cause the CGI script /cgi-local/ to be executed.

If you place your .htaccess file containing the DirectoryIndex specification in the root directory of your site, it will apply for all sub-directories at your site.


Preventing People from Linking to Your Images

Add the following to the .htaccess file:

# Rewrite Rule for images
RewriteCond %{HTTP_REFERER} <URL of page accessing your domain>
RewriteRule ^(.*)$ http://<same as above URL>

You would replace the <URL of page accessing your domain> above with the domain name and path of the page that is referring to your domain. For example:

The RewriteCond directive states that if the {HTTP_REFERER} matches the URL that follows, then use the RewriteRule directive. The RewriteRule directive will redirect any reference back to the referring web page.


Prev | Next | .htaccess Modifications

A metaphor. A philosophy. A way of doing business.

Copyright 1997-2001 - Last update: Wednesday, March 21, 2001 at 2:07:44 PM