WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I installed WordPress in the subdiretory /de and activated multisite features. The main blog has the URL/path: mysite.de/de

Now I want to add a second site for the English language with the following url: mysite.de/en

But after I added the site, the subdirectory for the English site was set as: mysite.de/de/en

Any ideas how I can get these site urls?

mysite.de/de
mysite.de/en
mysite.de/fr
share|improve this question

Here's a proper multisite solution:

Install WordPress directly on the root of your domain mysite.de. After that, setup a multisite and chose the sub domain option (Yes, subdomain. It's far more flexible but you can use it with subdirectories as well).

WordPress will ask you to update wp-config.php and .htaccess. To the wp-config.php add the following constants (in addition to the one provided by WP)

define( "COOKIEDOMAIN", "" );
define( "ADMIN_COOKIE_PATH", "/" );
define( 'SITECOOKIEPATH', '/' );

Don't use the .htaccess code provided by WordPress but use instead this one:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

Go to the network admin menu and create two sites, one for each language. You will get asked for the site address (subdomain). Just enter de for the German site and en for the English one. After the site has been created, edit it directly. Now you can edit the complete URL. Just set it to http://mysite.de/de and http://mysite.de/en. Do this also for the French site.

Now you have four sites in your network, probably with the following IDs:

1 mysite.de/
2 mysite.de/de
3 mysite.de/en
4 mysite.de/fr

As you don't need the first one, you can leave it just empty. You just don't use it. Manage your content in the other thre sites.

To redirect requests to mysite.de/ add another line to your .htaccess above the others:

RedirectMatch permanent "^/$" http://mysite.de/de

You now have a full functional network of two active sites for your content.

Finally a personal recommendation: There's a free plugin called Multilingual Press that supports this concept of a multilingual setup in a network. Disclamer: I contributed to this plugin before and working for a company that develops this plugin.

share|improve this answer

It would be far easier to maintain the blog by using a good WordPress translation plugin.

WPML (http://wpml.org) is my favourite plugin for the task. If you prefer not to pay anything QTranslate is also a good option.

Both plugins allow you to have sub domains (en.mysite.de) or language folders (mysite.de/en).

Best of luck!

share|improve this answer
    
These plugins might offer a solution for multilingual websites, but they does not solve the problem at all. – David yesterday

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.