You can do this RewriteRule ^(.*) index.php?file=$1 ErrorDocument 404 notfound.php but how do you redirect a missing file, i.e. 404 with the file name to another location? For example on 404 redirect to site.com/file?file=$1 Any ideas? Some say it can be done, others say it can't.