# Replace www.domain.com with your site domain # Comment this line if you get '500 Server Error' Options +FollowSymlinks RewriteEngine on # yoursitedomain.com -> www.domain.com RewriteCond %{HTTP_HOST} ^domain.com [NC] RewriteCond %{REQUEST_URI} !^/forums RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L] # index.php to / RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/ RewriteCond %{THE_REQUEST} !^POST RewriteRule ^index\.php$ http://www.domain.com/ [R=301,L] RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://domain\.com/[./]*$ [NC] RewriteCond %{HTTP_REFERER} !^http://domain\.com [NC] RewriteCond %{HTTP_REFERER} !^http://www\.domain\.com/[./]*$ [NC] RewriteCond %{HTTP_REFERER} !^http://www\.domain\.com [NC] RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]