ErrorDocument 404 /index.php RewriteEngine on RewriteCond %{HTTP_HOST} ^(www\.)?theperfectwelcome.com\.com$ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /301-redirect.php?url=$1 [R=301,L]