I don't know how to add the following codes correctly and sequentially in the .htaccess the codes are :- Options +FollowSymLinks RewriteEngine On ErrorDocument 300 http://www.mysite.com ErrorDocument 301 http://www.mysite.com ErrorDocument 302 http://www.mysite.com ErrorDocument 303 http://www.mysite.com ErrorDocument 400 http://www.mysite.com ErrorDocument 401 http://www.mysite.com ErrorDocument 402 http://www.mysite.com ErrorDocument 403 http://www.mysite.com ErrorDocument 404 http://www.mysite.com ErrorDocument 500 http://www.mysite.com ErrorDocument 501 http://www.mysite.com ErrorDocument 502 http://www.mysite.com ErrorDocument 503 http://www.mysite.com Code (markup): RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://mysite.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://mysite.com$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.mysite.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.mysite.com$ [NC] RewriteRule .*\.(.*.*)$ http://www.mysite.com [R,NC] Code (markup): How can I add both of these codes correctly. Please help me regarding this.