Solution
If you're facing problems getting mod_rewrite to work even after placing the code into your .htaccess file, it might be because you left out the first line, that looks like: "RewriteEngine On".
This line of code should always be placed on the first line of your rewrite code, so that it enables the mod_rewrite feature that rewriting requires.
The following code block is sample rewriting code that is used in WordPress:
RewriteEngine On #Taking note that this line must be there in order to enable mod_rewrite
RewriteBase /
#uploaded files
RewriteRule ^(.*/)?files/$ index.php [L]
RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]
# add a trailing slash to /wp-admin
RewriteCond %{REQUEST_URI} ^.*/wp-admin$
RewriteRule ^(.+)$ $1/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . - [L]
RewriteRule� ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
RewriteRule� ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]