I have a WordPress Multisite installation here: mydomain.com I use it to have different languages like:
mydomain.com/fr
mydomain.com/de
...
Now we are changing design, but we would like to do step by step, language by language.
So we have installed another Wordpress Multisite in the folder /new, that it's working perfectly with sites like
mydomain.com/new/fr
mydomain.com/new/de
...
We would like to redirect JUST THE FRENCH language to the new wordpress. I've tried with this .htaccess in the root folder (based on the information in Wordpress documentation:
RewriteCond %{HTTP_HOST} ^mydomain.com$
RewriteCond %{REQUEST_URI} !^/fr/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^fr(.*)$ /new/fr/$1
RewriteCond %{HTTP_HOST} ^mydomain.com$
RewriteRule ^fr(/)?$ /new/fr/index.php [L]
But that is giving a "Error establishing a database connection". It's weird because, as I explained, the site mydomain.com/new/fr is working perfectly.
NOTE: we don't want to use subdomains, I know that would make a different approach and solution ;-)
EDIT: The error is because this query
SELECT blog_id FROM wp_blogs WHERE domain IN ( 'mydomain.com' ) AND path IN ( '/fr/', '/' ) ORDER BY CHAR_LENGTH(path) DESC LIMIT 1
I guess, the redirection is working well, but when the wordpress inside "new" directory tries to determine which blog to visit, it reads the URL and it's in "/" really, since the redirection rule has an [L] and keeps the original URL in the apache environment variables.
R=301
? – revo