RewriteEngine On
RewriteBase /

# redirect wrong language code we used before
RewriteRule ^zh_tw/?(.*)$ /zh-tw/$1 [L,R=301]

# redirect all requests to non-existing translations to EN
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^[a-z-]*/(.+) $1 [L,R=301]

# Redirect /sharepic to sharepic generator
#RewriteRule ^sharepic$ https://sharepic.fsfe.org/pmpc [R=301,L]
RewriteRule ^([a-z-]*/)?sharepics?/? https://sharepic.fsfe.org/pmpc [R=301,L]

# Redirect 404 errors to nice page
ErrorDocument 404 /404.html
