Worpress Multisite & Multilanguage


#1

Hi guys, i've followed your instruction about wordpress multisite on nginx, but i have an issue with domain mapping.

I setted up WPML on my domain.com and subsites in subdomains, so the structure is siteX.domain.com/YZ (where YZ is language code added by WPML) and everithing works.

Now i've added cnames for domain.it and siteX.domain.it as alias of domain.com/it and siteX.domain.com/it in DNS registrar's panel, but it shows just a welcome message by nginx.

I tried to add server_name domain.com *.domain.com domain.it *.domain.it in /etc/nginx/sites-available/domain.com and also to uncomment first lines where is written listen 80 and server redirect, but without results.

What have i forgotten? Thanks


#2

The correct line is:

listen 80 default_server;

Next, basically you want to map domain.it to domain.com/it. This kind of mapping can not be handled from tutorials.

domain.it will point to domain.com only.

I think in WPML, language codes can be set using cookies. So in Nginx you can use map { } feature to set language based on TLD.

That way, domain.it will map to domain.com but with default language to italian.


#3