test mod_rewrite in apache

Make sure your httpd.conf includes:
.
.
LoadModule rewrite_module
.
.

AllowOverride All
Order allow,deny
Allow from all
RewriteEngine On

Next, edit .htaccess in /rewritedirectory and add
RewriteEngine On
RewriteRule
eg: ^link([^/]*).html$ rewrite.php?link=$1

To test if its working properly:

Edit test_rewrite.php in /rewritedirectory

<?php
switch($_GET['link'])
{
case 1: echo 'no mod_rewrite';break;
case 2: echo 'mod_rewrite';break;
default: echo 'mod_rewrite test';break;
}
echo 'test mod_rewrite‘;
?>