1

I have a multilingual WordPress site that has two languages: en and tr, It's site A.

I wanna put my other WordPress site inside /tr/shop/ folder, It's site B.

Just need only these rules:

  • /en/anything/ goes to site A (also /en/)
  • /tr/anything/ goes to site A (also /tr/)
  • /tr/shop/ goes to site B inside the /tr/shop subfolder.

Currently:

  • If visitors go to /en/ or /en/anything, It's OK.
  • If visitors go to /tr/shop/, they see site B, It's OK. Because the folder exists.
  • Visitors who go to /tr/* see a 404 error. Because /tr/ is a physical folder but empty. It's just a language prefix, not a physical folder. I need to exclude /tr/ folder from requests.

How can I do it?

My current .htaccess is below but not working.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /

# Exclude /tr/ from rewriting
RewriteRule ^tr(/.*)?$ - [L]

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# Beginning of shop part
RewriteRule ^tr/shop(/.*)?$ /tr/shop/$1 [L]
RewriteRule ^tr(/.*)?$ /index.php [L]
# End of shop part
</IfModule>
3

0

You must log in to answer this question.