RewriteEngine on
AddDefaultCharset utf-8
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?mydomain.com/.*$ [NC]
RewriteRule .(gif|jpg|png)$ http://www.mydomain.com/angryman.gif [R,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php?url=$1 [NC,QSA,L,PT]
#RewriteCond %{REQUEST_FILENAME} -f
#RewriteRule ^(.*).(php)$ /index.php?url=$1 [NC,QSA,L,PT]
#TODO: study rewrite cond and direct requests for files such as php appropritely
#What should I do with a request for a php file?