RewriteEngine On
RewriteBase /
ErrorDocument 404 /404.html
RewriteRule pic/([a-zA-Z0-9]+)\.jpg /pic\.php\?url==$1 [L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]