RewriteEngine On RewriteCond %{HTTP_REFERER} !^http://(www\.)?dominio.com(/)?.*$ [NC] RewriteRule .*\.(php)$ http://dominio.com [R,NC]