Forum Moderators: phranque
I use this search friendly rewriting rule for a secondary language version of my site.
RewriteEngine On
RewriteRule ^pl/(.*)$ /$1?lang=pl
is it possible, when someone requests an address of a nonegsisting page but the addres contains "?lang=pl" or starts with "/pl/", that he gets an alternate language version of the 404 page?
thanks for help.
You can use Apache's content negotiation -- see mod_negotiation -- to deliver content based on the browser's language preference settings.
You can also try declaring custom error pages, and rewriting those error pages just as you have done for your content:
ErrorDocument 404 /404.html
#
RewriteEngine on
#
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /pl/
RewriteRule ^404.html$ /404_pl.html [L]
#
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /en/
RewriteRule ^404.html$ /404_en.html [L]
#
RewriteRule ^pl/(.*)$ /$1?lang=pl
Jim