I am trying to create 404 pages (also other errors), depending on the language, solely based on the Apache mod_rewrite rules, evaluating the Accept-Language client HTTP header. I managed to show the correct pages (default English) using these rules:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{HTTP:Accept-Language} ^es [NC]
RewriteRule (.+) /esp/error404.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule (.+) /eng/error404.php [L]
My problem is that I would like to support 404 errors, and I understand that redirecting does not allow this type of flag. I am by no means 100% sure if it really costs SEO wise, since it is better not to have 404s at all, but I thought it would be more logical and support logical sequences, etc., but I just can not understand how to achieve this through apache and HTTP: Accept-Language.
Any comments would be mostly appreciated.