302 redirect language subfolder to website root in wordpress

We have temporarily suspended the French and German versions of a client site built in WordPress, as the translations were extremely outdated. We want to 302 the www.example.com/fra/ and www.example.com/deu/ subfolders and all related URLs to www.example.com until the new translations are ready.

Researching on stackoverflow lead me to add the following code to .htaccess, but it doesn’t work completely. www.example.com/fra/ redirects correctly, but www.example.com/fra/xxx redirects to www.example.com/xxx, while example.com/fra (no trailing slash) gives a 404.

Read More
RedirectMatch 302 ^/fra/.*$ http://www.example.com
RedirectMatch 302 ^/deu/.*$ http://www.example.com

Any suggestions gratefully received!

Related posts

Leave a Reply