I have a multilingual wordpress site that went live and replaces the old site.
Not every language is translated yet, so I want to keep the old site alongside wordpress for the other languages.
example.de-> new wordpress siteexample.de/zh-hans/*-> redirect toexample.de/cn/example.de/zh-hans/-> redirect toexample.de/cn/example.de/en/*-> redirect toexample.de/en/example.de/en/-> just stay onexample.de/en/
My .htaccess looks like this at the moment:
Redirect 302 /zh-hans/ /cn/
RedirectMatch 302 ^/(zh-hans)/. /cn/
Redirect 302 /ja/ /jp/
RedirectMatch 302 ^/(ja)/. /jp/
RedirectMatch 302 ^/(en)/. /en/
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
en, jp and cn are actual folders with index.html files in them. WordPress uses en, ja and zh-hans for these languages.
I have some problems with this:
- Only
example.de/ja/andexample.de/zh-hans/are working as intended example.de/ja(without ending slash) and all other language paths like that just redirect toexample.de/example.de/en,example.de/en/end up in a redirect loop- everything that comes after and ending slash (
example.de/ja/some-path) is opened by wordpress with a 404-page
At this point I have no idea how to handle this and I've tried different combinations for hours.
Is there even a way to handle this via .htaccess?