Skip to content Skip to site navigation


People who click on one URL can be directed to another automatically. For example, people who might try to access your web page at can be redirected to instead. This is handy if your web page has changed locations, or if you want to do some fancy web navigation tricks.

Selective redirects

You can set up redirects for certain files by using a .htaccess file(pronounced "dot - ht - access" file). The paragraphs below provide an overview.

The .htaccess files work by interrupting the web server before it can get its hands on the page it's searching for. The .htaccess file itself is just a small text file with brief instructions that tell the server what to do. For redirects, the instructions look like this:

Redirect [www server path] [absolute URL]

For example, to redirect requests for your file "marge.html" to the Simpsons web site, create a file called .htaccess and place it into the same directory as "marge.html". This .htaccess file will contain only the following line:

Redirect /~yourname/marge.html

If you want to redirect an entire web site (as opposed to just a single page), just redirect the directory that contains that site. So, given the example above, you'd use the name of the directory, not the page, in order to redirect everything below or within that directory, like so:

Redirect /~yourname/

Last modified June 7, 2011